about summary refs log tree commit diff
path: root/src/libexpr/lexer.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/lexer.l')
-rw-r--r--src/libexpr/lexer.l6
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;
             }