Skip to content

fix: highlight type, enum, func, import and internal keywords - #6207

Merged
max-sixty merged 1 commit into
mainfrom
docs/highlight-missing-keywords
Aug 18, 2026
Merged

fix: highlight type, enum, func, import and internal keywords#6207
max-sixty merged 1 commit into
mainfrom
docs/highlight-missing-keywords

Conversation

@prql-bot

@prql-bot prql-bot commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

The book's and website's highlight.js keyword lists have drifted from the lexer: type, enum, func, import and internal are all keywords in the lexer's keyword parser but render as plain identifiers. type appears 9 times and enum 3 times in the book's reference examples, so the gap is visible on pages the docs already ship. This adds the five missing keywords to both copies and notes the lexer as the source of truth.

The two files must stay identical below their headers — each says so in a comment — so both get the same edit; I verified the bodies are still byte-identical afterwards, and both parse under node --check.

Scope, and the drift left behind

in and as are already in these lists but are not lexer keywords — both are std functions, declared in std.prql. I left them rather than widen a keyword-sync change into a behavioural one — worth a look separately.

The playground's Monaco tokenizer (web/playground/src/workbench/prql-syntax.js) carries a third copy of the list, drifted further still (let and prql only). It uses a different tokenizer format, so syncing it is a separate change rather than the same edit applied a third time.

The book's own keyword reference page omits enum and import from its list. Same drift, also left for a separate change.

The other grammars under grammars/ have the same class of drift, in varying amounts. I deliberately did not touch them here: each uses a different format, none can be exercised locally, and a sweep across all of them is much harder to review than this one. #2052 (tests for syntax grammars) is the durable fix — until then a mechanical sweep risks silently breaking a grammar nobody would notice.

No regression test: there is no harness for the highlighters, which is what #2052 tracks. Verification here is node --check on both files plus the byte-identical body diff.

@max-sixty
max-sixty merged commit fcf02fb into main Aug 18, 2026
39 checks passed
@max-sixty
max-sixty deleted the docs/highlight-missing-keywords branch August 18, 2026 15:52
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