diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-05 16:19:45 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-05 16:19:45 +0200 |
commit | f32b030bda0bfa13cc664b6b2a769660064b2478 (patch) | |
tree | a7dbbc12170731f16c12e82760d82a58de489f1b | |
parent | e07efd58188abc7283884af348dbcb9786824a8b (diff) |
Add a comment
-rw-r--r-- | src/lexer.l | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lexer.l b/src/lexer.l index ec765d9..725e778 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -43,13 +43,16 @@ ws [ \t] {ws}+ ; + /* Throw an error on an invalid token. When in interactive mode we + should slurp up all data on the current line after reporting the + error so that lexing/parsing doesn’t continue right after the + offending token but instead on the next line typed by the user. */ . { user_error("%s:%d: Unrecognized character ‘%c’", current_file, yylineno, *yytext); BEGIN(error); return YYerror; } - <error>.* { BEGIN(0); } %% |