Skip to content

Fix: restore @egen as SPECIAL_TOKEN to fix comment parsing regression#6

Open
manticore-projects wants to merge 1 commit intojavacc:releasefrom
manticore-projects:release
Open

Fix: restore @egen as SPECIAL_TOKEN to fix comment parsing regression#6
manticore-projects wants to merge 1 commit intojavacc:releasefrom
manticore-projects:release

Conversation

@manticore-projects
Copy link
Copy Markdown

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).

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).
@manticore-projects
Copy link
Copy Markdown
Author

Please please please consider JSQLParser Grammar as a comprehensive Unit Test.
JavaCC 8.1.0 worked fine and then suddenly JavaCC 8.1.1 broke comment parsing completely -- and no-one noticed?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant