diff options
Diffstat (limited to 'discover/grub2/lexer.l')
-rw-r--r-- | discover/grub2/lexer.l | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/discover/grub2/lexer.l b/discover/grub2/lexer.l index 0558ed9..e1aad99 100644 --- a/discover/grub2/lexer.l +++ b/discover/grub2/lexer.l @@ -3,6 +3,8 @@ #include "grub2.h" #include "parser.h" #include <talloc/talloc.h> + +void yyerror(struct grub2_parser *parser, const char *fmt, ...); %} %option nounput noinput @@ -118,7 +120,10 @@ VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#]) /* strip comments */ #.* ; -. printf("unknown token '%s'\n", yytext); exit(1); +. { + yyerror(yyget_extra(yyscanner), "unknown token '%s'\n", yytext); + yyterminate(); + } %% |