From d9788ffe20b51a5a12c9763c54e2f67e75c3d99c Mon Sep 17 00:00:00 2001 From: prql-bot <107324867+prql-bot@users.noreply.github.com> Date: Wed, 19 Aug 2026 07:21:23 +0000 Subject: [PATCH 1/3] docs: highlight all lexer keywords in the playground and in-repo grammars --- grammars/CotEditor/PRQL.yaml | 8 ++++++++ grammars/GtkSourceView/prql.lang | 11 +++++++++++ grammars/KSyntaxHighlighting/prql.xml | 13 +++++++++++++ web/playground/src/workbench/prql-syntax.js | 14 +++++++++++++- 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/grammars/CotEditor/PRQL.yaml b/grammars/CotEditor/PRQL.yaml index f4ddf5a3e91e..d685cde7759b 100644 --- a/grammars/CotEditor/PRQL.yaml +++ b/grammars/CotEditor/PRQL.yaml @@ -27,10 +27,18 @@ keywords: - beginString: sort - beginString: take - beginString: window + # Keep in sync with the lexer's `keyword` parser in + # prqlc/prqlc-parser/src/lexer/mod.rs - beginString: case - beginString: let - beginString: module - beginString: prql + - beginString: into + - beginString: type + - beginString: internal + - beginString: func + - beginString: import + - beginString: enum commands: - beginString: abs - beginString: any diff --git a/grammars/GtkSourceView/prql.lang b/grammars/GtkSourceView/prql.lang index f01219385eaa..5f9bf67a0517 100644 --- a/grammars/GtkSourceView/prql.lang +++ b/grammars/GtkSourceView/prql.lang @@ -39,8 +39,19 @@ true + let + into + case + type + module + internal + func + import + enum diff --git a/grammars/KSyntaxHighlighting/prql.xml b/grammars/KSyntaxHighlighting/prql.xml index 4787c364b383..228b8936aedc 100644 --- a/grammars/KSyntaxHighlighting/prql.xml +++ b/grammars/KSyntaxHighlighting/prql.xml @@ -14,6 +14,18 @@ module + import + + + + + case + enum + func + internal + into @@ -137,6 +149,7 @@ + diff --git a/web/playground/src/workbench/prql-syntax.js b/web/playground/src/workbench/prql-syntax.js index 57d297221c20..14d673f3bd66 100644 --- a/web/playground/src/workbench/prql-syntax.js +++ b/web/playground/src/workbench/prql-syntax.js @@ -17,7 +17,19 @@ const TRANSFORMS = [ ]; const MODULES = ["date", "math", "text"]; const BUILTIN_FUNCTIONS = ["case"]; // "in", "as" -const KEYWORDS = ["let", "prql"]; +// Keep in sync with the lexer's `keyword` parser in +// prqlc/prqlc-parser/src/lexer/mod.rs. `case` is listed above. +const KEYWORDS = [ + "let", + "prql", + "into", + "type", + "module", + "internal", + "func", + "import", + "enum", +]; const LITERALS = ["null", "true", "false"]; const def = { From 2e54e6a4f2c848de649c3a5a8171dcf2d58d84b4 Mon Sep 17 00:00:00 2001 From: prql-bot <107324867+prql-bot@users.noreply.github.com> Date: Wed, 19 Aug 2026 07:29:30 +0000 Subject: [PATCH 2/3] docs: highlight `prql` in the KSyntaxHighlighting grammar `prql` sat in the `modules_builtin` list, which no context references, so it rendered as a plain identifier. --- grammars/KSyntaxHighlighting/prql.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grammars/KSyntaxHighlighting/prql.xml b/grammars/KSyntaxHighlighting/prql.xml index 228b8936aedc..a9d078fece1e 100644 --- a/grammars/KSyntaxHighlighting/prql.xml +++ b/grammars/KSyntaxHighlighting/prql.xml @@ -18,14 +18,14 @@ + prqlc/prqlc-parser/src/lexer/mod.rs; `let` and `type` are below. --> case enum func internal into + prql From 9ebdbf3a30dd0732ceb060a08c8e1f348b8b13f5 Mon Sep 17 00:00:00 2001 From: prql-bot <107324867+prql-bot@users.noreply.github.com> Date: Wed, 19 Aug 2026 07:33:47 +0000 Subject: [PATCH 3/3] docs: style GtkSourceView keywords with `keyword`, bump KSyntax version --- grammars/GtkSourceView/prql.lang | 10 ++++------ grammars/KSyntaxHighlighting/prql.xml | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/grammars/GtkSourceView/prql.lang b/grammars/GtkSourceView/prql.lang index 5f9bf67a0517..6e0f76500c44 100644 --- a/grammars/GtkSourceView/prql.lang +++ b/grammars/GtkSourceView/prql.lang @@ -20,7 +20,6 @@