1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

* Allow "$" in strings as long as they are not followed by "{". (Too

bad flex doesn't have lexical restrictions, the current solution
  isn't quite right...)
This commit is contained in:
Eelco Dolstra 2006-09-01 12:04:06 +00:00
parent c9586b6c3f
commit de90fdf908
3 changed files with 7 additions and 2 deletions

View file

@ -77,7 +77,11 @@ inherit { return INHERIT; }
}
\" { BEGIN(STRING); return '"'; }
<STRING>([^\$\"\\]|\\.)+ {
<STRING>([^\$\"\\]|\$[^\{\"]|\\.)+ {
/* !!! Not quite right: we want a follow restriction on "$", it
shouldn't be followed by a "{". Right now "$\"" will be consumed
as part of a string, rather than a "$" followed by the string
terminator. Disallow "$\"" for now. */
yylval->t = unescapeStr(yytext); /* !!! alloc */
return STR;
}