From de90fdf908f2504e1a89a5d4660552cbcc1a15d5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Sep 2006 12:04:06 +0000 Subject: * 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...) --- src/libexpr/lexer.l | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libexpr') 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 '"'; } -([^\$\"\\]|\\.)+ { +([^\$\"\\]|\$[^\{\"]|\\.)+ { +/* !!! 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; } -- cgit 1.4.1