Fixed bug in handling of extern (x) declarations

This commit is contained in:
Hackerpilot 2012-04-22 13:49:37 -07:00
parent ba862d2475
commit d42cf075f5
1 changed files with 11 additions and 9 deletions

View File

@ -218,6 +218,7 @@ string parseTypeDeclaration(const Token[] tokens, ref size_t index)
break buildingType;
}
}
stderr.writeln("type = ", type);
return type;
}
@ -275,25 +276,26 @@ Module parseModule(const Token[] tokens, string protection = "public", string[]
else if (tokens[index] == TokenType.assign)
tokens.skipBlockStatement(index);
break;
case TokenType.tDeprecated:
case TokenType.tNothrow:
case TokenType.tOverride:
case TokenType.tSynchronized:
case TokenType.atDisable:
case TokenType.atProperty:
case TokenType.atSafe:
case TokenType.atSystem:
case TokenType.tAbstract:
case TokenType.tConst:
case TokenType.tDeprecated:
case TokenType.tExtern:
case TokenType.tFinal:
case TokenType.t__gshared:
case TokenType.tStatic:
localAttributes ~= tokens[index++].value;
break;
case TokenType.tConst:
case TokenType.tImmutable:
case TokenType.tInout:
case TokenType.tNothrow:
case TokenType.tOverride:
case TokenType.tPure:
case TokenType.tScope:
case TokenType.tShared:
case TokenType.tStatic:
case TokenType.tSynchronized:
auto tmp = tokens[index++].value;
if (tokens[index] == TokenType.lParen)
type = tmp ~ parenContent(tokens, index);
@ -302,10 +304,10 @@ Module parseModule(const Token[] tokens, string protection = "public", string[]
index++;
attributes ~= tmp;
}
else
localAttributes ~= tmp;
localAttributes ~= tmp;
break;
case TokenType.tAlign:
case TokenType.tExtern:
string attribute = tokens[index++].value;
if (tokens[index] == TokenType.lParen)
attribute ~= parenContent(tokens, index);