Upgraded frontend to DMD 1.035

This commit is contained in:
Tomas Lindquist Olsen
2008-10-06 16:22:11 +02:00
parent e109025c00
commit 06a55194d7
17 changed files with 130 additions and 57 deletions

View File

@@ -2374,6 +2374,7 @@ Initializer *Parser::parseInitializer()
Loc loc = this->loc;
Token *t;
int braces;
int brackets;
switch (token.value)
{
@@ -2461,6 +2462,39 @@ Initializer *Parser::parseInitializer()
return is;
case TOKlbracket:
/* Scan ahead to see if it is an array initializer or
* an expression.
* If it ends with a ';', it is an array initializer.
*/
brackets = 1;
for (t = peek(&token); 1; t = peek(t))
{
switch (t->value)
{
case TOKlbracket:
brackets++;
continue;
case TOKrbracket:
if (--brackets == 0)
{ t = peek(t);
if (t->value != TOKsemicolon &&
t->value != TOKcomma &&
t->value != TOKrcurly)
goto Lexpression;
break;
}
continue;
case TOKeof:
break;
default:
continue;
}
break;
}
ia = new ArrayInitializer(loc);
nextToken();
comma = 0;
@@ -4247,7 +4281,7 @@ Expression *Parser::parsePrimaryExp()
nextToken();
if (token.value != TOKrbracket)
{
while (1)
while (token.value != TOKeof)
{
Expression *e = parseAssignExp();
if (token.value == TOKcolon && (keys || values->dim == 0))
@@ -4525,10 +4559,13 @@ Expression *Parser::parseUnaryExp()
tk = peek(tk); // skip over right parenthesis
switch (tk->value)
{
case TOKnot:
tk = peek(tk);
if (tk->value == TOKis) // !is
break;
case TOKdot:
case TOKplusplus:
case TOKminusminus:
case TOKnot:
case TOKdelete:
case TOKnew:
case TOKlparen:
@@ -5149,6 +5186,7 @@ Expression *Parser::parseNewExp(Expression *thisexp)
void Parser::addComment(Dsymbol *s, unsigned char *blockComment)
{
s->addComment(combineComments(blockComment, token.lineComment));
token.lineComment = NULL;
}