From cfb35037cdf2852364f930cfe828725a3f397fd6 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 12 Apr 2019 11:18:02 -0700 Subject: [PATCH] Use reject to improve grammar --- python.flx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python.flx b/python.flx index 15cf9a0..7f9d9af 100644 --- a/python.flx +++ b/python.flx @@ -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[^ ] { printf("NEWLINE\n"); handle_indent(0); unput(yytext[1]); } \n printf("NEWLINE\n"); <> { handle_indent(0); return 0; }