diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-05 16:10:19 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-05 16:10:19 +0200 |
commit | e07efd58188abc7283884af348dbcb9786824a8b (patch) | |
tree | c090229d9834818f0d2550675f560c610949d550 | |
parent | 0ef367f61d437c1820ce067197b25ae088678d05 (diff) |
Don’t parse if a lexing error occurs
-rw-r--r-- | src/lexer.l | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lexer.l b/src/lexer.l index 8100405..ec765d9 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -17,6 +17,8 @@ extern const char *current_file; ws [ \t] +%x error + %% ¬|! { return NOT; } @@ -44,6 +46,10 @@ ws [ \t] . { user_error("%s:%d: Unrecognized character ‘%c’", current_file, yylineno, *yytext); + BEGIN(error); + return YYerror; } +<error>.* { BEGIN(0); } + %% |