Repository navigation
feat(sql): upgrade JSqlParser to 5.4 with token-based syntax reasons - #44
Merged
Merged
Conversation
JSqlParser 5.4 merges SimpleNode into Node and states syntax errors with parser-internal token kinds and lexical states. Syntax reasons are now composed from the unexpected token itself: `Encountered unexpected token: "<image>"` with line breaks escaped, or `Encountered unexpected end of input`, followed by a location for schema sources only. Lexical errors keep the parser's wording. 5.4 lexes $$...$$ as one literal and nests block comments as PostgreSQL does, so a $N inside either is left as text and is not bound.
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.
Summary
Upgrades the SQL parser from JSqlParser 5.3 to 5.4. Version 5.4 removes the
SimpleNodeAPI and reports syntax errors with parser-internal token kinds and lexical states, so sqlcj now builds its syntax reasons from the unexpected token itself. Diagnostics stay one line, name no parser internals, and carry a location only for schema sources.Changes
jsqlparser.versionto 5.4 and replace the removedSimpleNodewithNodein the parameter compiler and its test fixture.Encountered unexpected token: "<image>", escaping line breaks in multi-line tokens, or asEncountered unexpected end of input. Schema sources appendat line N, column M; queries keep their existing header-line location.after prefixtoafter:.$$...$$) is one literal and block comments nest, as in PostgreSQL, so a$Ninside either stays text and is not bound.Scope and non-goals
after:wording.