Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before adding new test cases that generate additional gaps in the generated lexer, I wanted to have the current reflection lexer test suite cover the generated lexer (to the extent possible, backreferences and match longest are not (yet) supported by generated lexer). This is an attempt at that, for discussion. It puts the rules for the test suite into the
lexer/internal
package (testutils), and then an internal utility is added to generate the JSON files, and then a Makefile is added to use these JSON files to regenerate the test lexers used by the test suite.The current tests expose that the current generated lexer doesn't support eliding matched tokens if the rule starts with a lowercase letter (e.g.,
whitespace
rule vsWhitespace
rule), so a few of the test cases for the generated sub-case are failing. For this reason, if you don't want test cases on the master branch failing, you may want to merge this onto a different branch for now.The PR appears large, but most of it is generated code needed for the test suite to run (which now depends on generated versions of more lexer definitions used in the lexer test suite).
My intent is to add onto this test suite with additional test cases for the lexer that highlight scenarios I've encountered where the reflection lexer is accurate but the generated lexer is not.