Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't dump statements in Parser::need, since this will only confuse t…
…hings.
  • Loading branch information
icculus committed Nov 20, 2017
1 parent a4902ff commit 35b2653
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mojobasic_parser.cpp
Expand Up @@ -299,8 +299,11 @@ AstProgram *Parser::run(const char *filename, const char *source, unsigned int s
const SourcePosition startpos(currentToken.position);

StatementCollector collector(startpos);
while (!want(TOKEN_EOI))
parseStatements(collector);
while (!want(TOKEN_EOI)) {
if (!parseStatements(collector)) {
failAndDumpStatement("Syntax error");
}
}

preprocessor_end(pp);
pp = NULL;
Expand Down Expand Up @@ -365,7 +368,7 @@ bool Parser::need(const Token t, const char *err) {
getNextToken();
return true;
} // if
failAndDumpStatement(err);
fail(err);
return false;
} // Parser::need

Expand Down

0 comments on commit 35b2653

Please sign in to comment.