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.



-- 
bvk.chaitanya
=== modified file 'ChangeLog.lexer-rewrite'
--- ChangeLog.lexer-rewrite     2010-01-22 13:37:27 +0000
+++ ChangeLog.lexer-rewrite     2010-01-25 16:30:38 +0000
@@ -1,3 +1,8 @@
+2010-01-25  BVK Chaitanya  <bvk.gro...@gmail.com>
+
+       * script/yylex.l: Accept parenthesis as part of word.
+       * script/parser.y: Remove GRUB_PARSER_TOKEN_{LPAR,RPAR} tokens.
+
 2010-01-10  BVK Chaitanya  <bvk.gro...@gmail.com>
 
        * conf/any-emu.rmk: Build rule updates.

=== modified file 'script/parser.y'
--- script/parser.y     2010-01-23 04:46:05 +0000
+++ script/parser.y     2010-01-25 14:37:33 +0000
@@ -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'
--- script/yylex.l      2010-01-23 04:44:32 +0000
+++ script/yylex.l      2010-01-25 14:32:10 +0000
@@ -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;      }
 

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to