Repository navigation
Fix nested comments, keywords as column names, xml .query(), MERGE USING VALUES - #68
Merged
Merged
Conversation
…RGE USING VALUES - Lexer: block comments nest, so /* a /* b */ c */ is one comment (#66) - Accept non-reserved keywords (MESSAGE, TYPE, QUERY, PASSWORD, ...) as column names in expressions, INSERT column lists, SET clauses and as method names after a dot (#65, #67) - MERGE ... USING (VALUES ...) AS alias (cols) parses as an InlineDerivedTable (#64) Golden ast.json files generated with TsqlAstParser. Fixes #64 Fixes #65 Fixes #66 Fixes #67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuRZ4JrivjQabmGfjNqrzq
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.
Requested by Kyle · project thread
Fixes the four open issues reported from the sqlc-gen-csharp SQL Server syntax matrix.
/* outer /* inner */ still outer */is a single comment.MESSAGEas a column name: addedisNonReservedKeywordfor keyword tokens that are not T-SQL reserved words (MESSAGE,TYPE,QUERY,PASSWORD,LOGIN,STATS,JOB,SEND,RECEIVE, ...). They're now accepted as column names in expressions,INSERTcolumn lists andUPDATE ... SET, and as parts of multi-part names. Of the other words the issue suggested checking,STATUS,LEVEL,NAME,ROLE,STATEandVALUEalready worked;TYPEhad the same bug and is fixed..query(): falls out of the MESSAGE is treated as a reserved word in expressions and column lists #65 change; a non-reserved keyword is now accepted as the method name after a dot.MERGE ... USING (VALUES ...) AS s (cols): the MERGE source path now routes(VALUESto the derived-table parser, producing anInlineDerivedTable.Tests
New golden tests (
ast.jsongenerated with TsqlAstParser / ScriptDom):NestedBlockComments,NonReservedKeywordsAsColumns,XmlQueryMethod,MergeUsingValues.go test ./parser/...passes;-check-todoenabled no additional tests.Fixes #64
Fixes #65
Fixes #66
Fixes #67
Generated by Claude Code