From f32b030bda0bfa13cc664b6b2a769660064b2478 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 5 Sep 2024 16:19:45 +0200 Subject: Add a comment --- src/lexer.l | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } - .* { BEGIN(0); } %% -- cgit v1.2.3