fix(where): make reserved-word, dotted, and non-ASCII column names addressable - #64
Merged
Conversation
…dressable Backticked names get a verbatim marker: they are never dot-split and never converted to the true/false/null literals, so `true` is now a column reference. A bare dotted name prefers a column literally so named (a header called foo.bar) and falls back to path traversal, keeping tags.length and nested access working. Docs generalize the backtick rule beyond 'headers with spaces'. Closes #59 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Closes #59, taking all three asks:
quotedon the lexer token): they skip thetrue/false/nullliteral conversion —`true` ~ /yes/now addresses a column namedtrue— and are never dot-split. Bare keywords keep their literal meaning.foo.bar) and resolution triesrow["foo.bar"]before path traversal. The issue's silent false negative (foo.bar ~ /x/→ 0 rows) and false positive (foo.bar == null→ match) are both gone; rows without such a key fall through to normal path resolution, sotags.length,name.length, and genuine nested access are unaffected (pinned by the existing "dot paths and .length" test plus new both-readings-exist coverage where the literal wins).--help,src/agent-context.txt, and the grammar comment now state the real rule: bare references are ASCII identifiers, a dot prefers a literal column then traverses, and backticks are for everything else (spaces, punctuation, non-ASCII, leading digits, reserved words). Non-ASCII names keep failing loudly when bare (cannot parse expression near) and work backticked.Tests
5 new expr tests: backticked keywords as columns (bare ones stay literals), dotted-name literal-first with fallback and precedence, backticked names never dot-split, and a non-ASCII (CJK) header. All three issue repros verified end-to-end through the CLI.
bun test test/: 162 pass,tsc --noEmitandoxfmt --checkclean.🤖 Generated with Claude Code