Skip to content

Commit

Permalink
Don't fail parsing if there are newlines at the end of the file.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Nov 21, 2017
1 parent bc33189 commit 3f89360
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mojobasic_parser.cpp
Expand Up @@ -301,8 +301,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)) {
while (true) {
if (!parseStatements(collector)) {
if (want(TOKEN_EOI)) {
break;
}
failAndDumpStatement("Syntax error");
}
}
Expand Down

0 comments on commit 3f89360

Please sign in to comment.