Skip to content

fix(playground): correct decimal regex and transforms list in syntax highlighting#5788

Merged
max-sixty merged 1 commit intomainfrom
fix/playground-syntax-highlighting
Apr 10, 2026
Merged

fix(playground): correct decimal regex and transforms list in syntax highlighting#5788
max-sixty merged 1 commit intomainfrom
fix/playground-syntax-highlighting

Conversation

@prql-bot
Copy link
Copy Markdown
Collaborator

Summary

  • Remove stray ] in the number-highlighting regex — decimals like 123.45 were only highlighting 123 (the fractional part failed to match)
  • Sync TRANSFORMS list with prqlc/prqlc/src/semantic/std.prql:
    • Remove union (it is not a built-in transform — it is shown as an example user-defined function in append.md#L44)
    • Add intersect, remove, and loop (all defined in std.prql)

Test plan

  • CI passes
  • Build the playground locally and verify decimal numbers and the added transforms highlight correctly (manual verification — no automated test harness exists for this Monaco tokenizer)

The playground tokenizer has no existing test harness; testing it would require a Monaco mock, which felt disproportionate for a two-character fix. Findings surfaced during nightly code survey of web/playground/src/workbench/prql-syntax.js.

🤖 Generated with Claude Code

…highlighting

The number-highlighting regex had a stray `]` in `(\.[\d_]+])?`, so
decimals like `123.45` were only highlighted as `123` — the fractional
part failed to match.

The `TRANSFORMS` list also diverged from `std.prql`: it contained `union`
(not a built-in transform — it's defined as an example user function in
`append.md`) and was missing `intersect`, `remove`, and `loop` (which are
defined in `std.prql`).

No tests: the playground tokenizer has no existing test harness and
testing a Monaco tokenizer would require a Monaco mock. Verified by
reading \`prqlc/prqlc/src/semantic/std.prql\` against the list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@max-sixty max-sixty merged commit d942e9d into main Apr 10, 2026
33 checks passed
@max-sixty max-sixty deleted the fix/playground-syntax-highlighting branch April 10, 2026 13:10
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