Skip to content

Commit

Permalink
Fix #81
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackerpilot committed Jan 25, 2016
1 parent b1f5058 commit 725529f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dparse/parser.d
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ class Parser
return null;
}
node.colonLocation = colon.index;
mixin (nullCheck!`node.declarationsAndStatements = parseDeclarationsAndStatements()`);
mixin (nullCheck!`node.declarationsAndStatements = parseDeclarationsAndStatements(false)`);
return node;
}

Expand Down Expand Up @@ -2135,13 +2135,15 @@ class Parser
* $(RULE declarationOrStatement)+
* ;)
*/
DeclarationsAndStatements parseDeclarationsAndStatements()
DeclarationsAndStatements parseDeclarationsAndStatements(bool includeCases = true)
{
mixin(traceEnterAndExit!(__FUNCTION__));
auto node = allocate!DeclarationsAndStatements;
DeclarationOrStatement[] declarationsAndStatements;
while (!currentIsOneOf(tok!"}", tok!"else") && moreTokens() && suppressedErrorCount <= MAX_ERRORS)
{
if (currentIs(tok!"case") && !includeCases)
break;
if (currentIs(tok!"while"))
{
auto b = setBookmark();
Expand Down

0 comments on commit 725529f

Please sign in to comment.