]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2/lexer.l
ui/ncurses: Use pmenu_item destrutor to free ncurses ITEMs
[petitboot] / discover / grub2 / lexer.l
index 0558ed9d791c38c12b852e1eba95389aa65b0915..e1aad9931252f98be623a5fc87035a61f3de4ef2 100644 (file)
@@ -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();
+       }
 
 %%