starter: Explicitly allow @# at the beginning of strings
Since we treat everything after # as comment identities of type ID_KEY_ID couldn't be parsed otherwise, unless quoted.
This commit is contained in:
@@ -79,7 +79,7 @@ static void include_files(parser_helper_t *ctx);
|
||||
yy_push_state(str, yyscanner);
|
||||
}
|
||||
|
||||
[^\"#= \t\n]+ {
|
||||
(@#)?[^\"#= \t\n]+ {
|
||||
yylval->s = strdup(yytext);
|
||||
return STRING;
|
||||
}
|
||||
|
||||
@@ -224,6 +224,9 @@ static struct {
|
||||
{ "conn foo # asdf\n\tkey=val", TRUE, "val" },
|
||||
{ "conn foo # asdf\n#\tkey=val", TRUE, NULL },
|
||||
{ "conn foo # asdf\n\t#key=val", TRUE, NULL },
|
||||
{ "conn foo # asdf\n\tkey=@#keyid", TRUE, "@#keyid" },
|
||||
{ "conn foo # asdf\n\tkey=\"@#keyid\"", TRUE, "@#keyid" },
|
||||
{ "conn foo # asdf\n\tkey=asdf@#keyid", TRUE, "asdf@" },
|
||||
{ "conn foo # asdf\n\tkey=#val", TRUE, NULL },
|
||||
{ "conn foo # asdf\n\tkey=val#asdf", TRUE, "val" },
|
||||
{ "conn foo # asdf\n\tkey=\"val#asdf\"", TRUE, "val#asdf" },
|
||||
|
||||
Reference in New Issue
Block a user