Skip to content

Resolve shadowed contextual keyword and data-type token warnings - #2597

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/contextual-token-warnings
Sep 11, 2026
Merged

Resolve shadowed contextual keyword and data-type token warnings#2597
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/contextual-token-warnings

Conversation

@minleejae

@minleejae minleejae commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

JavaCC reports ten remaining shadowed/unreachable token warnings from #2403. Three also hide real parsing failures: MATCHING in UNION ... BY NAME MATCHING (...) and DISTRIBUTED RECOVERY in ALTER SYSTEM are lexed as identifiers but the grammar expects unreachable literal tokens.

Consume these words with a shared contextual-keyword production, retaining their use as ordinary identifiers elsewhere. Remove seven unreachable dedicated-keyword alternatives from DATA_TYPE; DataType() already handles those token kinds directly. This keeps the change separate from a broader token redesign.

Validation: the three affected statement examples failed on master and pass with this change. Full Gradle check and Maven clean verify, plus regressions for contextual words as identifiers, dedicated data-type tokens/casts, operation identity, round trips, and invalid contextual keywords. All ten warnings reported by this issue that remained on master are removed; the pre-existing WITH lookahead warning remains.

Integration validation: all twelve existing PRs plus these three independent fixes pass full Gradle check together (6,495 tests; 0 failures/errors; 25 skipped). Existing dialect-enum, shared-index-helper and documentation conflicts were resolved only in the local validation branch.

Fixes #2403.

Share contextual keyword consumption for MATCHING and DISTRIBUTED RECOVERY, and remove unreachable dedicated-keyword alternatives from DATA_TYPE. Keep these words usable as identifiers and preserve existing type parsing.

Fixes JSQLParser#2403.
@manticore-projects
manticore-projects merged commit 51e29a0 into JSQLParser:master Sep 11, 2026
9 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you much for cleaning this up!

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.

compileJavacc emits JavaCC warnings for shadowed literals and unreachable DATA_TYPE branches

2 participants