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.
This is something I started last week—it's some improvements to the JavaCC parser that shave off a few hundred lines of code. The bulk of those come from rewriting the operator parsing to use "precedence climbing", to use the terminology of this article, instead of the "classic solution" (one non-terminal per precedence level).
This isn't really directly related to #1 or #2, but it makes editing the JavaCC grammar and digging through the JavaCC debugging output a little less painful. It should have no effect on the behavior of the parser.
As a side effect, it seems to speed up the parser a bit. For example, parsing the normalized prelude is around 6% faster in a benchmark I've included here. Before:
After:
The jar is also slightly smaller (104K instead of 108). Both of those improvements were non-goals, though, and I would have been happy to see either go the other way.