diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-09-01T12·04+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-09-01T12·04+0000 |
commit | de90fdf908f2504e1a89a5d4660552cbcc1a15d5 (patch) | |
tree | 7f7670b5bc4a157eb5466f38e03c8fe2fc152e3b /src | |
parent | c9586b6c3f32b22eec8791fd9b49c81ec3f5fcf6 (diff) |
* 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...)
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/lexer.l | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index 892543ec2eeb..fb19e16b457c 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -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; } |