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:
Tobias Brunner
2014-06-19 14:00:49 +02:00
parent 2d88617e7d
commit 6719c4c828
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -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;
}
+3
View File
@@ -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" },