]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2/grub2-lexer.l
lib/process: Allow process output to be retrieved on each event
[petitboot] / discover / grub2 / grub2-lexer.l
index 52575e390713a3a6b1fe576a6fb0a76ae7abf0c0..b55a71578a93413f1be1251bc3e680a9b9bc3097 100644 (file)
@@ -23,7 +23,9 @@ void yyerror(struct grub2_parser *parser, const char *fmt, ...);
 
 WORD   [^{}|&$;<> \t\n'"#]+
 DELIM  [ \t]+
-VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#])
+BLANK  ["]{2}|[']{2}
+NUMBER 0|[1-9][0-9]*
+VARNAME ([[:alpha:]][_[:alnum:]]*|{NUMBER}|[\?@\*#])
 
 %%
 
@@ -52,6 +54,12 @@ VARNAME ([[:alpha:]][_[:alnum:]]*|[0-9]|[\?@\*#])
 "until"      return TOKEN_UTIL;
 "while"      return TOKEN_WHILE;
 
+ /* ignore quoted empty strings */
+{BLANK} {
+               yylval->word = create_word_text(yyget_extra(yyscanner), "");
+               yyget_extra(yyscanner)->inter_word = true;
+               return TOKEN_WORD;
+       }
  /* anything that's not a metachar: return as a plain word */
 {WORD} {
                yylval->word = create_word_text(yyget_extra(yyscanner), yytext);