about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-02-05T13·38+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-02-05T13·38+0000
commit0ed89c569f95d884fb8107a555f8a03672a0fffd (patch)
treefb679f1b82aacb4fe0aad3cc1b75c33d26fd3237
parent4066f450c2ea56f90eba819564a112ec5ba2ee09 (diff)
* Fix the parsing of
    ''
      '${foo}'
    ''
    
  where the antiquote should work as expected, instead of giving the
  string "'${foo}'".

-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 cf90f2939d24..b7c1d19f8a5c 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -124,7 +124,7 @@ inherit     { return INHERIT; }
 <STRING>.   return yytext[0]; /* just in case: shouldn't be reached */
 
 \'\'(\ *\n)?     { BEGIN(IND_STRING); return IND_STRING_OPEN; }
-<IND_STRING>([^\$\']|\$[^\{\']|\'[^\'])+ {
+<IND_STRING>([^\$\']|\$[^\{\']|\'[^\'\$])+ {
                    yylval->t = makeIndStr(toATerm(yytext));
                    return IND_STR;
                  }
@@ -142,6 +142,10 @@ inherit     { return INHERIT; }
                  }
 <IND_STRING>\$\{ { BEGIN(INITIAL); return DOLLAR_CURLY; }
 <IND_STRING>\'\' { BEGIN(INITIAL); return IND_STRING_CLOSE; }
+<IND_STRING>\'   {
+                   yylval->t = makeIndStr(toATerm("'"));
+                   return IND_STR;
+                 }
 <IND_STRING>.    return yytext[0]; /* just in case: shouldn't be reached */
 
 {PATH}      { yylval->t = toATerm(yytext); return PATH; /* !!! alloc */ }