Skip to content

fix: sync syntax highlighters with std lib#6028

Merged
max-sixty merged 4 commits into
mainfrom
fix/sync-syntax-highlighters
Jun 25, 2026
Merged

fix: sync syntax highlighters with std lib#6028
max-sixty merged 4 commits into
mainfrom
fix/sync-syntax-highlighters

Conversation

@prql-bot

Copy link
Copy Markdown
Collaborator

The nightly survey reviewed the two syntax-highlighting definitions and found they had drifted from the std lib (prqlc/prqlc/src/semantic/std.prql) and from each other:

  • grammars/KSyntaxHighlighting/prql.xml — the date_functions list only contained to_text, missing the other three functions the date module exports: now, diff, trunc (std.prql L230-233). The types list also carried int128, which is not a PRQL type — std.prql defines no int128, and the type-system spec's sized-int roadmap stops at int64 (web/book/src/reference/spec/type-system.md). It was also absent from the highlight-prql.js sibling list, so removing it realigns the two highlighters.
  • web/book/highlight-prql.jsDATATYPES listed timestamp but not its siblings date and time, although all three are type primitives defined together in std.prql (L45-47).

These are documentation/grammar definition files with no unit-test harness in the repo (the book just loads highlight-prql.js via book.toml), so no regression test accompanies the change — consistent with prior grammar fixes such as #5957.

Add missing date functions (now, diff, trunc) and date/time types to the
KSyntaxHighlighting and highlight.js definitions, and drop the non-existent
int128 type from the KSyntaxHighlighting types list.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@max-sixty

Copy link
Copy Markdown
Member

The edits here check out against std.prql: the date module is exactly now, to_text, diff, trunc; int128 isn't a PRQL type; and date/time/timestamp are all primitives. CI is green.

One gap, though. web/book/highlight-prql.js has a header comment to keep it consistent with web/website/themes/prql-theme/static/plugins/highlight/prql.js, and the two DATATYPES lists were identical before this PR. Adding date/time to the book file but not the website file makes them diverge, and no CI check guards that pairing. The website highlighter is also still missing date/time relative to std.prql.

Adding date/time to web/website/themes/prql-theme/static/plugins/highlight/prql.js would complete the sync and keep both files aligned.

This was written by Claude Code on behalf of max

Sync web/website/themes/prql-theme/static/plugins/highlight/prql.js with
the book highlighter so both DATATYPES lists stay identical, per review
feedback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@prql-bot

Copy link
Copy Markdown
Collaborator Author

Good catch — added date/time to web/website/themes/prql-theme/static/plugins/highlight/prql.js in 5d6fe4c so its DATATYPES list matches the book file again. The two lists are now identical, and both are aligned with the primitives in std.prql.

prql-bot and others added 2 commits June 25, 2026 03:51
int128 is not a PRQL type (not in PrimitiveSet, std.prql, or the
type-system spec roadmap, which stops at int64). The KSyntax highlighter
already dropped it; remove it from the emacs, CotEditor, GtkSourceView,
and codemirror-demo grammars too so all definitions stay consistent.

Co-Authored-By: Claude <noreply@anthropic.com>
The date-functions context only listed to_text, missing now, diff, and
trunc — the same drift fixed for KSyntaxHighlighting in this PR. The date
module in std.prql exports all four.

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit 2227bed into main Jun 25, 2026
37 checks passed
@max-sixty max-sixty deleted the fix/sync-syntax-highlighters branch June 25, 2026 04:43
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.

2 participants