Fix: restore @egen as SPECIAL_TOKEN to fix comment parsing regression#6
Open
manticore-projects wants to merge 1 commit intojavacc:releasefrom
Open
Fix: restore @egen as SPECIAL_TOKEN to fix comment parsing regression#6manticore-projects wants to merge 1 commit intojavacc:releasefrom
manticore-projects wants to merge 1 commit intojavacc:releasefrom
Conversation
Commit 81b04ee moved /*@egen*/ from SPECIAL_TOKEN to a separate MORE block, and moved /*@bgen(jjtree) out of the comments MORE block into that same separate block. This broke parsing of /* and /** comments because the separate MORE block's "/*" prefix interfered with the comment MORE block's NFA — the lexer failed to match "/*" as a comment opener, instead tokenizing "/" as SLASH and "*" as STAR. Fix: restore the original architecture where @egen variants are SPECIAL_TOKEN (separate NFA, no prefix conflict) and @bgen variants are in the same MORE block as the comment patterns (shared NFA handles the "/*" prefix correctly via longest-match). The new -1c/-1l/-0l variants from 81b04ee are preserved, just placed in the correct token specification categories. Fixes comment parsing failure on grammars with /* or /** comments (e.g. JSqlParser with 500+ productions).
Author
|
Please please please consider JSQLParser Grammar as a comprehensive Unit Test. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Commit 81b04ee moved /@egen/ from SPECIAL_TOKEN to a separate MORE block, and moved /@bgen(jjtree) out of the comments MORE block into that same separate block. This broke parsing of / and /** comments because the separate MORE block's "/" prefix interfered with the comment MORE block's NFA — the lexer failed to match "/" as a comment opener, instead tokenizing "/" as SLASH and "*" as STAR.
Fix: restore the original architecture where @egen variants are SPECIAL_TOKEN (separate NFA, no prefix conflict) and @bgen variants are in the same MORE block as the comment patterns (shared NFA handles the "/*" prefix correctly via longest-match).
The new -1c/-1l/-0l variants from 81b04ee are preserved, just placed in the correct token specification categories.
Fixes comment parsing failure on grammars with /* or /** comments (e.g. JSqlParser with 500+ productions).