From fa8c97d84f847c503532b36e44b5e904888077a1 Mon Sep 17 00:00:00 2001 From: servostar Date: Tue, 14 May 2024 12:27:21 +0200 Subject: [PATCH] lexer unknown token passthrough --- .gitignore | 3 +++ src/lex/lexer.l | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bb676ce..10613c6 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ parser.tab.c parser.tab.h build /Testing/ +CTestTestfile.cmake +DartConfiguration.tcl +*.cmake diff --git a/src/lex/lexer.l b/src/lex/lexer.l index d0e6d10..2c96d23 100644 --- a/src/lex/lexer.l +++ b/src/lex/lexer.l @@ -94,5 +94,5 @@ \"([^\"\n])*\" {DEBUG("\"%s\" tokenized with \'ValStr\'", yytext); yylval.string = strdup(yytext); return(ValStr);}; \"\"\"([^\"\n]|\\\n)*\"\"\" {DEBUG("\"%s\" tokenized with \'ValMultistr\'", yytext); yylval.string = strdup(yytext); return(ValMultistr);}; [ \r\t] { /* ignore whitespace */ }; -. { }; +. { return yytext[0]; /* passthrough unknown token, let parser handle the error */ }; %%