Repository navigation
feat(lexers): add Quint and TLA+ lexers - #1493
Merged
Merged
Conversation
Quint (*.qnt) and TLA+ (*.tla, aliases tla/tlaplus), including PlusCal inside (* --algorithm ... *) blocks. Rules are plain patterns, so the XML also loads on Chroma v2. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
alecthomas
enabled auto-merge (squash)
November 16, 2026 21:29
alecthomas
approved these changes
Nov 16, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 17, 2026
Follow-up to #1493. The TLA+ lexer only knew the ASCII spellings plus part of the Unicode set, so Unicode specs (as written by tools such as [tlauc](https://github.com/tlaplus-community/tlauc)) lost highlighting on the rest. This covers every symbol in tlauc's `tla-unicode.csv`, which comes from the TLA+ standard's ASCII-to-Unicode table: - `≜` is now treated like `==`, so `Foo ≜ ...` and `M ≜ INSTANCE ...` mark the defined name - `⟨ ⟩` are punctuation like `<< >>` - arrows and temporal operators: `→ ← ↦ ↝ □ ◇ ⇔ ⇸` - turnstiles, dots and the rest: `⊢ ⊣ ⫤ ‖ ‥ … ‼ ⁇ ⁺ ∷ ≔ ⩴`, plus `∖` - `ℕ ℤ ℝ` as builtins New test `lexers/testdata/tlaplus/unicode.*` exercises them; a check over its recorded output shows no non-ASCII symbol left as plain `Text`. `go test ./lexers` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds lexers for two specification languages that currently have none:
*.qnt, aliasquint)*.tla, aliasestlaandtlaplus), including PlusCal inside(* --algorithm ... *)blocksKeyword sets follow the languages' VS Code grammars (quint-vscode, vscode-tlaplus); the rest is written from the language references. TLA+ handles nested
(* *)comments,\h/\b/\oliterals,\in-style operators, unicode operators,Module!Opreferences, and operator definitions. Quint handles///doc comments, sum-type variants, anddef/val/action/typedeclaration names.Tests:
lexers/testdata/quint.*andtlaplus.*(inputs written for this PR).go test ./lexerspasses, andlexers_gen.gois regenerated.The rules use plain
patternregexes (nowords=), so the same XML also loads on Chroma v2; I checked it against v2.23.1 and v2.27.0 because Forgejo pins v2 and I built it with these lexers to confirm files and Markdown fences highlight.🤖 Generated with Claude Code