* Disallow unescaped $ in string literals.

This commit is contained in:
Eelco Dolstra 2006-05-01 15:29:46 +00:00
parent 0064599a27
commit 7276e194ee

View file

@ -73,10 +73,7 @@ inherit { return INHERIT; }
}
\" { BEGIN(STRING); return '"'; }
<STRING>([^\$\"\\]|\\.|\$[^\{\$])+ {
/* Note: a dollar *is* allowed as-is in a string, as long as it's
not followed by a open brace. This should probably be disallowed
eventually. */
<STRING>([^\$\"\\]|\\.)+ {
yylval->t = unescapeStr(yytext); /* !!! alloc */
return STR;
}