From d4f0b0fc6cdb9ae2fd5fc057d621bc80b36a7b18 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 12 Apr 2010 22:03:27 +0000 Subject: * Indented strings. --- src/libexpr/lexer.l | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/libexpr/lexer.l') diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index e905700fded5..7aa05db8c447 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -111,10 +111,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. */ + /* !!! 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->e = unescapeStr(yytext); return STR; } @@ -124,25 +125,25 @@ inherit { return INHERIT; } \'\'(\ *\n)? { BEGIN(IND_STRING); return IND_STRING_OPEN; } ([^\$\']|\$[^\{\']|\'[^\'\$])+ { - //yylval->t = makeIndStr(toATerm(yytext)); + yylval->e = new ExprIndStr(yytext); return IND_STR; } \'\'\$ { - //yylval->t = makeIndStr(toATerm("$")); + yylval->e = new ExprIndStr("$"); return IND_STR; } \'\'\' { - //yylval->t = makeIndStr(toATerm("''")); + yylval->e = new ExprIndStr("''"); return IND_STR; } \'\'\\. { - //yylval->t = unescapeStr(yytext + 2); + yylval->e = new ExprIndStr(yytext + 2); return IND_STR; } \$\{ { BEGIN(INITIAL); return DOLLAR_CURLY; } \'\' { BEGIN(INITIAL); return IND_STRING_CLOSE; } \' { - //yylval->t = makeIndStr(toATerm("'")); + yylval->e = new ExprIndStr("'"); return IND_STR; } . return yytext[0]; /* just in case: shouldn't be reached */ -- cgit 1.4.1