aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-12-06 10:20:58 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-12-06 10:20:58 +0000
commitb42ef9c0544009b372e3da0275553ce08cf0ea2a (patch)
tree28afd5929bde8db2fa5f82583193c6beb20d998f /src
parentd4950f207f18e635cc13e3ee33103fd501456384 (diff)
* Syntax to escape '', ${.
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/lexer.l12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index 23a14324f..cf90f2939 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -128,6 +128,18 @@ inherit { return INHERIT; }
yylval->t = makeIndStr(toATerm(yytext));
return IND_STR;
}
+<IND_STRING>\'\'\$ {
+ yylval->t = makeIndStr(toATerm("$"));
+ return IND_STR;
+ }
+<IND_STRING>\'\'\' {
+ yylval->t = makeIndStr(toATerm("''"));
+ return IND_STR;
+ }
+<IND_STRING>\'\'\\. {
+ yylval->t = unescapeStr(yytext + 2);
+ return IND_STR;
+ }
<IND_STRING>\$\{ { BEGIN(INITIAL); return DOLLAR_CURLY; }
<IND_STRING>\'\' { BEGIN(INITIAL); return IND_STRING_CLOSE; }
<IND_STRING>. return yytext[0]; /* just in case: shouldn't be reached */