Mercurial > projects > dil
changeset 157:fdbd47d72614
- Renamed class StringLiteralExpression to StringLiteralsExpression.
- Modified code for parsing StringLiteralsExpression.
author | aziz |
---|---|
date | Fri, 13 Jul 2007 11:05:01 +0000 |
parents | 53c667aabbf2 |
children | 759f437313f9 |
files | trunk/src/Expressions.d trunk/src/Parser.d |
diffstat | 2 files changed, 9 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/Expressions.d Fri Jul 13 10:23:05 2007 +0000 +++ b/trunk/src/Expressions.d Fri Jul 13 11:05:01 2007 +0000 @@ -494,11 +494,11 @@ { this.tok = tok; } } -class StringLiteralExpression : Expression +class StringLiteralsExpression : Expression { - string str; - this(string str) - { this.str = str; } + Token*[] strLiterals; + this(Token*[] strLiterals) + { this.strLiterals = strLiterals; } } class ArrayLiteralExpression : Expression
--- a/trunk/src/Parser.d Fri Jul 13 10:23:05 2007 +0000 +++ b/trunk/src/Parser.d Fri Jul 13 11:05:01 2007 +0000 @@ -1517,22 +1517,13 @@ e = new CharLiteralExpression(token.type); break; case T.String: - char[] buffer = token.str; - char postfix = token.pf; - nT(); - while (token.type == T.String) + Token*[] stringLiterals; + do { - string tmp = token.str; -// if (postfix != token.pf) -// error(); - if (tmp.length > 1) - { - buffer[$-1] = tmp[0]; // replace '\0' - buffer ~= tmp[1..$]; // append the rest - } + stringLiterals ~= token; nT(); - } - e = new StringLiteralExpression(buffer); + } while (token.type == T.String) + e = new StringLiteralsExpression(stringLiterals); break; case T.LBracket: Expression[] values;