Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes error recovery logic in the parser run-time (tested & verified …
…using the errorlab.js test file): previously 5 tests would fail, but after this fix, all pass. The loop which looks for a matching error rule has been abstracted out into the function locateNearestErrorRecoveryRule() because the first cause for failed the tests was the parseError() handler firing before the erorr recovery could kick in: this (and user-defined) parseError handlers need a way to detect whether an error recovery rule is available (via the hash.recoverable boolean). The tests also uncovered an infinitely loop in error recovery in the new code when the lexer hits EOF. This bug has been fixed.
- Loading branch information
1 parent
569d426
commit d48466f
Showing
1 changed file
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters