Use reject to improve grammar

This commit is contained in:
Danila Fedorin 2019-04-12 11:18:02 -07:00
parent 5c7f1879bf
commit cfb35037cd

View File

@ -25,9 +25,9 @@ void handle_indent(int l) {
%% %%
^(#[^\n]*)?\n[^ ] { handle_indent(0); unput(yytext[yyleng-1]); } ^[^ ] { handle_indent(0); REJECT }
^(#[^\n]*)?\n {} ^(#[^\n]*)?\n {}
\n[^ ] { printf("NEWLINE\n"); handle_indent(0); unput(yytext[1]); }
\n printf("NEWLINE\n"); \n printf("NEWLINE\n");
<<EOF>> { handle_indent(0); return 0; } <<EOF>> { handle_indent(0); return 0; }