Skip to content

Commit

Permalink
fix(parse): Synchronize after statement parse errors
Browse files Browse the repository at this point in the history
Rather than infinitely reporting an error at the same location (not very
helpful), we should move on to the next statement boundary (only a
':' or newline so far) and continue parsing.
  • Loading branch information
sjbarag committed Jan 15, 2018
1 parent 5c9405a commit 6a67e98
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function declaration(): Statement | undefined {

return statement();
} catch (error) {
synchronize();
return;
}
}
Expand Down

0 comments on commit 6a67e98

Please sign in to comment.