fix: sync syntax highlighters with std lib#6028
Conversation
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>
|
The edits here check out against One gap, though. Adding
|
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>
|
Good catch — added |
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>
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— thedate_functionslist only containedto_text, missing the other three functions thedatemodule exports:now,diff,trunc(std.prql L230-233). Thetypeslist also carriedint128, which is not a PRQL type — std.prql defines noint128, and the type-system spec's sized-int roadmap stops atint64(web/book/src/reference/spec/type-system.md). It was also absent from thehighlight-prql.jssibling list, so removing it realigns the two highlighters.web/book/highlight-prql.js—DATATYPESlistedtimestampbut not its siblingsdateandtime, 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.jsviabook.toml), so no regression test accompanies the change — consistent with prior grammar fixes such as #5957.