X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fgrub2%2Flexer.l;h=e1aad9931252f98be623a5fc87035a61f3de4ef2;hp=0558ed9d791c38c12b852e1eba95389aa65b0915;hb=ffc167572a9d56c52908aebefe62ba3e3e2a9cf8;hpb=300859ca50c0ea5d9c17d27fd3e3538ce966e08a 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 + +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(); + } %%