Merged DMD 2.021 frontend.

Removed generated files from dmd/dmd2 dirs.
This commit is contained in:
Tomas Lindquist Olsen
2008-12-13 16:14:37 +01:00
parent 6716aecc52
commit b7bea99dbb
32 changed files with 744 additions and 1938 deletions

View File

@@ -70,8 +70,26 @@ Array *Parser::parseModule()
if (token.value == TOKmodule)
{
unsigned char *comment = token.blockComment;
bool safe = FALSE;
nextToken();
if (token.value == TOKlparen)
{
nextToken();
if (token.value != TOKidentifier)
{ error("module (safe) identifier expected");
goto Lerr;
}
Identifier *id = token.ident;
if (id == Id::system)
safe = TRUE;
else
error("(safe) expected, not %s", id->toChars());
nextToken();
check(TOKrparen);
}
if (token.value != TOKidentifier)
{ error("Identifier expected following module");
goto Lerr;
@@ -95,7 +113,7 @@ Array *Parser::parseModule()
id = token.ident;
}
md = new ModuleDeclaration(a, id);
md = new ModuleDeclaration(a, id, safe);
if (token.value != TOKsemicolon)
error("';' expected following module declaration instead of %s", token.toChars());
@@ -445,7 +463,7 @@ Array *Parser::parseDeclDefs(int once)
}
ident = token.ident;
nextToken();
if (token.value == TOKcomma)
if (token.value == TOKcomma && peekNext() != TOKrparen)
args = parseArguments(); // pragma(identifier, args...)
else
check(TOKrparen); // pragma(identifier)
@@ -3429,7 +3447,7 @@ Statement *Parser::parseStatement(int flags)
}
ident = token.ident;
nextToken();
if (token.value == TOKcomma)
if (token.value == TOKcomma && peekNext() != TOKrparen)
args = parseArguments(); // pragma(identifier, args...);
else
check(TOKrparen); // pragma(identifier);
@@ -5557,7 +5575,7 @@ Expression *Parser::parseExpression()
/*************************
* Collect argument list.
* Assume current token is '(' or '['.
* Assume current token is ',', '(' or '['.
*/
Expressions *Parser::parseArguments()