X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=discover%2Fgrub2%2Flexer.l;h=aca474af3e96e286deed352230d557e3d246d808;hb=882f61e8eb44ec9f9becc32328667c65f364d066;hp=ab26f4be2e1b465e5522d02299b3703ef3465e5e;hpb=fb5a2b71f85614114663c86dbba62c5c491a11b9;p=petitboot diff --git a/discover/grub2/lexer.l b/discover/grub2/lexer.l index ab26f4b..aca474a 100644 --- a/discover/grub2/lexer.l +++ b/discover/grub2/lexer.l @@ -6,11 +6,13 @@ %} %option nounput noinput +%option batch never-interactive %option warn %option noyywrap %option stack noyy_top_state %option reentrant %option bison-bridge +%option yylineno %option noyyalloc noyyfree noyyrealloc %option extra-type="struct grub2_parser *" %option header-file="lexer.h" @@ -19,7 +21,7 @@ %x sqstring %x dqstring -WORD [^{}|&$;<> \t\n'"]+ +WORD [^{}|&$;<> \t\n'"#]+ VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#]) %% @@ -36,6 +38,7 @@ VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#]) "do" return TOKEN_DO; "done" return TOKEN_DONE; "elif" return TOKEN_ELIF; +"else" return TOKEN_ELSE; "esac" return TOKEN_ESAC; "fi" return TOKEN_FI; "for" return TOKEN_FOR; @@ -44,6 +47,7 @@ VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#]) "in" return TOKEN_IN; "menuentry" return TOKEN_MENUENTRY; "select" return TOKEN_SELECT; +"submenu" return TOKEN_SUBMENU; "then" return TOKEN_THEN; "time" return TOKEN_TIME; "until" return TOKEN_UTIL; @@ -112,8 +116,7 @@ VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#]) [ \t]*(;|\n)[ \t]* return TOKEN_EOL; /* strip comments */ -#.*$ ; - +#.* ; . printf("unknown token '%s'\n", yytext); exit(1);