Visitar URL original
Fix CopyOption FirstTokenIndex and LastTokenIndex (#179) by ZEUSXXIV · Pull Request #213 · microsoft/SqlScriptDOM · GitHub
Skip to content

Fix CopyOption FirstTokenIndex and LastTokenIndex (#179) - #213

Merged
Leila Lali (llali) merged 1 commit into
microsoft:mainfrom
ZEUSXXIV:fix-copy-option-token-index
Jul 20, 2026
Merged

Leila Lali (llali) merged 1 commit into
microsoft:mainfrom
ZEUSXXIV:fix-copy-option-token-index

Conversation

@ZEUSXXIV

Copy link
Copy Markdown
Contributor

Description

Fixes #179.

Adds missing UpdateTokenInfo calls on the CopyOption fragment in the copyOption parser rule in TSql130.g. This ensures that parsed CopyOption AST nodes correctly populate their token location boundaries, setting FirstTokenIndex pointing to the option identifier (e.g. FILE_TYPE, IDENTITY_INSERT, CREDENTIAL) rather than their value, and LastTokenIndex pointing to the end of the option value. Also adds a targeted unit test verifying these token boundaries.

Code Changes

@llali
Leila Lali (llali) merged commit bb623c8 into microsoft:main Jul 20, 2026
1 check passed
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.

Incorrect FirstTokenIndex returned by the CopyStatement.Options fragment

2 participants