Making parenthesis part of word; fixes set root=(hd1,1) issue
PATCH 1/1 Making parenthesis part of word; fixes set root=(hd1,1) issue
Hi,
Recent lexer-rewrite merge into experimental has an issue, that it rejects "set root=(hd1,1)" statement (because its not valid syntax in BASH, which is what GRUB script was trying to emulate). Attached patch fixes this issue, by treating parenthesis as valid word alphabets.
Signature · 1 line
bvk.chaitanya
=== modified file 'ChangeLog.lexer-rewrite'
ChangeLog.lexer-rewrite +5 -0
@@ -1,3 +1,8 @@ +2010-01-25 BVK Chaitanya <[email protected]> + + * script/yylex.l: Accept parenthesis as part of word. + * script/parser.y: Remove GRUB_PARSER_TOKEN_{LPAR,RPAR} tokens. + 2010-01-10 BVK Chaitanya <[email protected]> * conf/any-emu.rmk: Build rule updates.
=== modified file 'script/parser.y'
parser.y +0 -2
@@ -45,8 +45,6 @@ %token GRUB_PARSER_TOKEN_PIPE "|" %token GRUB_PARSER_TOKEN_AMP "&" %token GRUB_PARSER_TOKEN_SEMI ";" -%token GRUB_PARSER_TOKEN_LPAR "(" -%token GRUB_PARSER_TOKEN_RPAR ")" %token GRUB_PARSER_TOKEN_LBR "{" %token GRUB_PARSER_TOKEN_RBR "}" %token GRUB_PARSER_TOKEN_NOT "!"
=== modified file 'script/yylex.l'
yylex.l +1 -3
@@ -128,7 +128,7 @@ BLANK [ \t] COMMENT ^[ \t]*#.*$ -CHAR [^|&$;()<> \t\n\'\"\\] +CHAR [^|&$;<> \t\n\'\"\\] DIGITS [[:digit:]]+ NAME [[:alpha:]_][[:alnum:][:digit:]_]*
@@ -157,8 +157,6 @@ "|" { RECORD; return GRUB_PARSER_TOKEN_PIPE; } "&" { RECORD; return GRUB_PARSER_TOKEN_AMP; } ";" { RECORD; return GRUB_PARSER_TOKEN_SEMI; } -"(" { RECORD; return GRUB_PARSER_TOKEN_LPAR; } -")" { RECORD; return GRUB_PARSER_TOKEN_RPAR; } "<" { RECORD; return GRUB_PARSER_TOKEN_LT; } ">" { RECORD; return GRUB_PARSER_TOKEN_GT; }