Fix SELECT tokenization before parenthesis - #891
Open
RamiNoodle733 wants to merge 2 commits into
Open
Conversation
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.
Fixes #775.
SELECTfollowed immediately by(is currently caught by the lexer rule that treats a word before a parenthesis as a function name. That meansselect(select 1)is grouped like a function instead of being parsed equivalently toselect (select 1).This change preserves
SELECTasKeyword.DMLwhen that function-name lookahead matches, allowing the following parenthesis to be grouped normally. Other function-like names keep the existing behavior.A regression test verifies that the no-space form reports statement type
SELECT, retains the DML token, and groups the nested query as aParenthesis.Validation: the automation environment could not obtain a runnable repository checkout because outbound git access is unavailable, so I did not claim a local pytest run. The branch is based directly on current upstream
master(60cdc649) and the diff is limited to the targeted lexer guard and regression test.