some bug fixes
This commit is contained in:
parent
836727564e
commit
1a0c3b4809
2 changed files with 4 additions and 4 deletions
|
@ -139,7 +139,7 @@ append_newline (const char *src)
|
||||||
grub_size_t len;
|
grub_size_t len;
|
||||||
|
|
||||||
len = grub_strlen (src);
|
len = grub_strlen (src);
|
||||||
line = grub_malloc (len + 1);
|
line = grub_malloc (len + 2);
|
||||||
if (!line)
|
if (!line)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -128,13 +128,13 @@ typedef grub_size_t yy_size_t;
|
||||||
BLANK [ \t]
|
BLANK [ \t]
|
||||||
COMMENT ^[ \t]*#.*$
|
COMMENT ^[ \t]*#.*$
|
||||||
|
|
||||||
CHAR [^|&;()<> \t\n\'\"]
|
CHAR [^|&$;()<> \t\n\'\"\\]
|
||||||
DIGITS [[:digit:]]+
|
DIGITS [[:digit:]]+
|
||||||
NAME [[:alpha:]_][[:alnum:][:digit:]_]*
|
NAME [[:alpha:]_][[:alnum:][:digit:]_]*
|
||||||
|
|
||||||
ESC \\.
|
ESC \\.
|
||||||
VARIABLE ${NAME}|$\{{NAME}\}|${DIGITS}|$\{{DIGITS}\}|$\?|$\{\?\}
|
VARIABLE ${NAME}|$\{{NAME}\}|${DIGITS}|$\{{DIGITS}\}|$\?|$\{\?\}
|
||||||
DQSTR \"([^\"]|\\\")*\"
|
DQSTR \"([^\\\"]|{ESC})*\"
|
||||||
SQSTR \'[^\']*\'
|
SQSTR \'[^\']*\'
|
||||||
WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
|
WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
|
||||||
|
|
||||||
|
@ -190,6 +190,7 @@ WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
|
||||||
{WORD} {
|
{WORD} {
|
||||||
RECORD;
|
RECORD;
|
||||||
/* resplit yytext */
|
/* resplit yytext */
|
||||||
|
grub_dprintf ("lexer", "word: [%s]\n", yytext);
|
||||||
yypush_buffer_state (YY_CURRENT_BUFFER, yyscanner);
|
yypush_buffer_state (YY_CURRENT_BUFFER, yyscanner);
|
||||||
if (yy_scan_string (yytext, yyscanner))
|
if (yy_scan_string (yytext, yyscanner))
|
||||||
{
|
{
|
||||||
|
@ -209,7 +210,6 @@ WORD ({CHAR}|{DQSTR}|{SQSTR}|{ESC}|{VARIABLE})+
|
||||||
return GRUB_PARSER_TOKEN_BAD;
|
return GRUB_PARSER_TOKEN_BAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Split word into multiple args */
|
/* Split word into multiple args */
|
||||||
|
|
||||||
<SPLIT>{
|
<SPLIT>{
|
||||||
|
|
Loading…
Reference in a new issue