1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

* Syntax to escape '', ${.

This commit is contained in:
Eelco Dolstra 2007-12-06 10:20:58 +00:00
parent d4950f207f
commit b42ef9c054
3 changed files with 20 additions and 2 deletions

View file

@ -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 */