Skip to content

Commit

Permalink
Consume remaining line tokens on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dicebot committed Aug 24, 2014
1 parent cc1079a commit 9873073
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/parse.c
Expand Up @@ -669,7 +669,16 @@ Dsymbols *Parser::parseDeclDefs(int once, Dsymbol **pLastDecl, PrefixAttributes
if ((pAttrs->protection.kind == PROTpackage) && (token.value == TOKlparen))
{
pkg_prot_idents = parseQualifiedIdentifier("protection package");
check(TOKrparen);

if (pkg_prot_idents)
check(TOKrparen);
else
{
while (token.value != TOKsemicolon && token.value != TOKeof)
nextToken();
nextToken();
break;
}
}
}

Expand Down Expand Up @@ -1245,6 +1254,8 @@ Identifiers* Parser::parseQualifiedIdentifier(const char* entity)
entity,
token.toChars()
);

return NULL;
}

Identifier *id = token.ident;
Expand Down

0 comments on commit 9873073

Please sign in to comment.