Fix mixin declarations

This commit is contained in:
Hackerpilot 2013-11-07 14:56:51 -08:00
parent 87ed0bd3b4
commit 00768c371a
1 changed files with 15 additions and 7 deletions

View File

@ -1686,18 +1686,26 @@ class ClassFour(A, B) if (someTest()) : Super {}}c;
{
auto b = setBookmark();
advance();
auto t = peekPastParens();
if (t !is null && t.type == TokenType.semicolon)
if (currentIs(TokenType.lParen))
{
goToBookmark(b);
node.mixinDeclaration = parseMixinDeclaration();
auto t = peekPastParens();
if (t !is null && t.type == TokenType.semicolon)
{
goToBookmark(b);
node.mixinDeclaration = parseMixinDeclaration();
}
else
{
goToBookmark(b);
error("Declaration expected");
advance();
return null;
}
}
else
{
goToBookmark(b);
error("Declaration expected");
advance();
return null;
node.mixinDeclaration = parseMixinDeclaration();
}
}
break;