• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AfterShip / clickhouse-sql-parser / 28727429863

05 Jul 2026 02:50AM UTC coverage: 53.204% (+0.2%) from 52.962%
28727429863

Pull #282

github

git-hulk
Split keywords into reserved and non-reserved sets

Revives #275 rebased onto current master (post-#276/#277 renames) and
addresses both review regressions.

matchTokenKind previously coerced every keyword token to match
TokenKindIdent, so any keyword could silently fill an identifier slot:
`SELECT a FROM WHERE b = 1` parsed as `SELECT a AS FROM WHERE b = 1`.

- New reservedKeywords set: statement/clause starters and expression
  operators no longer match identifier positions, so a missing name
  fails fast at the clause keyword. All other keywords stay usable as
  bare identifiers.
- parseAnyKeyword accepts any keyword - reserved or not - in positions
  where context has already proven the token is a name: after AS, after
  a dot in a qualified name, or a lookahead-disambiguated select item.

Review fixes on top of the original branch:
- Operator keywords stay callable as ClickHouse functions when followed
  by '(': and(a, b), or(a, b), in(1, [1]), like(s, p), ilike(s, p).
  parseIdentOrFunction now accepts a keyword name in that case.
- Reserved keywords are accepted as aliases after AS in expression
  lists (`SELECT (1 AS from)`, `sum(x AS from)`), ORDER BY
  (`ORDER BY x AS from`) and non-parenthesized CTEs
  (`WITH 1 AS from SELECT from`), per review suggestions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pull Request #282: Split keywords into reserved and non-reserved sets

78 of 88 new or added lines in 5 files covered. (88.64%)

28 existing lines in 1 file now uncovered.

8644 of 16247 relevant lines covered (53.2%)

3034.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.97
/parser/parser_column.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc