Repository navigation
fix(tokenizer): point unterminated-literal errors at the opener (byte columns, a tab is one column) - #827
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Claude finished @ajitpratap0's task in 28s —— View job Review of PR #827
I only read the code. I did not run the tests, and I didn't re-check your golden comparison. Summary: This is a clean, well-scoped fix. It replaces the three different ways error locations were built (raw Correctness
Performance: Tests
Nits
No blocking issues. LGTM from a code-review standpoint, pending CI. |
1e92e07 to
adfe981
Compare
|
Claude finished @ajitpratap0's task in 26s —— View job Review of PR #827 (updated)I read the diff and the surrounding tokenizer code. I did not run the tests. Summary: The change is correct and well scoped. Error locations now go through one shared rule, Correctness
Documentation mismatch (worth fixing before merge)
Tests
Nits
No blocking code issues. The only requested change is to correct the "tab counts as 4" wording in the PR title and description. |
Unterminated quoted identifiers (newline), dollar-quoted strings and SQL Server bracket identifiers built error locations from raw cursor fields, reporting column 0 or the end of input. All tokenizer and StringLiteralReader error locations now go through the same rule as token spans (1-based line, byte column, a tab counting as one column; locationAt shares lineLocation with toSQLPosition) and point at the opening delimiter (escape errors: the character after the backslash). Golden digests regenerated; only error locations changed (verified: 0 token, error-code or message differences across 153 changed (entry, dialect) results). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KTj1PEbxzVCETkeYrZKcrE
|
Review notes (comment only, no pushes from my side). Tab rule. #826 (merged, fixes #797) defines every position as a 1-based byte column where a tab is 1 column ( Conflict. The merge conflict is textual, not semantic. #827 refactors the body of Overlap with #830. #827 already covers #830 item 1: the If #827 lands with item 1, #830 can be trimmed to items 2 and 3 (or just 2). |
adfe981 to
60d6a7b
Compare
|
Claude finished @ajitpratap0's task in 27s —— View job Review of PR #827 (re-review after sync)I read the diff against Summary: The change is correct and well scoped. All the touched error sites now go through the same rule, Correctness
Open items
Tests (optional)
No blocking code issues. The PR needs the description fix and a golden regeneration check after the rebase. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RkzVu3JY9Y6BRWfjesWts9
|
Merged origin/main into this branch to resolve conflicts (normal merge commit, fast-forward push; no force-push, no rebase).
Also corrected the PR title/body wording: a tab counts as one column (not 4). 🤖 Generated with Claude Code |
|
Claude finished @ajitpratap0's task in 20s —— View job Review of PR #827 (after sync with main)I read the diff against Summary: The change is correct and well scoped. Every touched error site now goes through Checked
Open items (not code)
Optional tests
No blocking code issues. This is ready once the description is corrected and the golden file is confirmed. |
|
Claude finished @ajitpratap0's task in 17s —— View job Review of PR #827 (after merge of main)I read the diff against Summary: The change is correct and well scoped. Every touched error site now goes through Correctness
Performance: Tests
Open item: Before merge, run No blocking issues. LGTM pending CI. |
Description
Follow-up from #825. Several tokenizer error paths built locations from raw cursor fields instead of
toSQLPosition:[bracketidentifiers: reported the end of input instead of the opening delimiter.StringLiteralReader: had the same problem.All error locations now use the same rule as token spans: 1-based line, byte column, tab counts as one column. Unterminated-literal errors point at the opener, and escape errors point at the character after the backslash.
Type of Change
Changes Made
pkg/sql/tokenizer/tokenizer.goandstring_literal.go: all error locations now go throughtoSQLPositionorlocationAt, which share one rule.error_location_test.go: a table test with tabs, multibyte characters and multi-line input. Each location is mapped back to the opener byte.testdata/tokenizer_literal_golden.json: regenerated with-update-literal-golden.Golden verification
For every golden entry whose digest changed, I printed the full tokenizer result for all 9 golden dialects, on
mainand on this branch, and compared them per entry and dialect:'''é€𝄞''' 'c\q'moves from column 14 (a rune count) to column 20, the byte after the backslash.Testing
task check(fmt, vet, golangci-lint, race tests) andtask test:cbindingBreaking Changes
None to the API. Error columns and lines for the affected errors change; tools that snapshot error positions may need updating.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KTj1PEbxzVCETkeYrZKcrE