Skip to content

Recognize TOP as a keyword - #940

Open
00200200 wants to merge 1 commit into
andialbrecht:masterfrom
00200200:codex/fix-703-top-keyword
Open

00200200 wants to merge 1 commit into
andialbrecht:masterfrom
00200200:codex/fix-703-top-keyword

Conversation

@00200200

Copy link
Copy Markdown

Fixes #703.

Recognize SQL Server's TOP as a keyword, including parenthesized row limits, so keyword case formatting handles it consistently.

Preserve qualified names such as schema. top(1) across whitespace and comments. The lexer tracks whether the preceding significant token was a dot instead of rescanning the input prefix.

Tests cover case variations, row-limit parentheses and whitespace, quoted identifiers, and qualified columns and functions. Twelve TOP regressions fail on master. With the fix, all 37 focused cases pass and the full suite reports 543 passed, 2 xfailed and 1 xpassed (the existing xfail/xpass results are unchanged).

Validated on Python 3.11.5/macOS; Ruff and git diff --check pass.

  • Tests run
  • Style checks pass
  • Regression coverage added
  • Changelog updated

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.

Does not correctly identify TOP from MSSQL

1 participant