From 0ed89c569f95d884fb8107a555f8a03672a0fffd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 5 Feb 2008 13:38:07 +0000 Subject: [PATCH] * Fix the parsing of '' '${foo}' '' where the antiquote should work as expected, instead of giving the string "'${foo}'". --- src/libexpr/lexer.l | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index cf90f2939..b7c1d19f8 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -124,7 +124,7 @@ inherit { return INHERIT; } . return yytext[0]; /* just in case: shouldn't be reached */ \'\'(\ *\n)? { BEGIN(IND_STRING); return IND_STRING_OPEN; } -([^\$\']|\$[^\{\']|\'[^\'])+ { +([^\$\']|\$[^\{\']|\'[^\'\$])+ { yylval->t = makeIndStr(toATerm(yytext)); return IND_STR; } @@ -142,6 +142,10 @@ inherit { return INHERIT; } } \$\{ { BEGIN(INITIAL); return DOLLAR_CURLY; } \'\' { BEGIN(INITIAL); return IND_STRING_CLOSE; } +\' { + yylval->t = makeIndStr(toATerm("'")); + return IND_STR; + } . return yytext[0]; /* just in case: shouldn't be reached */ {PATH} { yylval->t = toATerm(yytext); return PATH; /* !!! alloc */ }