>_EXECUTIVE SUMMARY
emacs-arb is the Emacs major mode for arb — a Tcl/Tk-flavored declarative language for visualizing and modifying Unix pipelines, on the fusevm bytecode VM + Cranelift JIT. arb-mode derives from prog-mode and provides font-lock, a syntax table, brace-aware indentation, filetype detection, a buffer runner (arb FILE via compile), eldoc + completion for the query verbs, and an LSP client that launches arb --lsp.
Design principle: the highlighted surface is arb's actual language surface — keywords, the widgets, the query verbs, input sources, directives, dotted widget paths, and /regex/ literals. Because arb has a finite corpus (a few hundred verbs / widgets / directives, unlike the sibling stryke with its ~10,450 generated builtins), the lists are plain regexp-opt alternations in arb-mode.el; no generated hash-table stdlib is required.
~WHY NO GENERATED STDLIB
The sibling emacs-stryke generates a 170 KB stryke-stdlib.el of hash tables because a single regexp-opt over stryke's ~10,450 builtins overflows Emacs' regexp compiler (invalid-regexp "Regular expression too big"). arb has no such problem: its corpus — the widgets, ~130 query verbs, input sources, directives, and keywords — is comfortably within the regexp-size limit. So arb-mode.el uses plain regexp-opt alternations, and arb-stdlib.el holds the query-verb / widget signatures used for eldoc and completion-at-point. Dotted widget paths (.codes) and /regex/ literals (which division a / b must not be mistaken for) are matched with a dedicated regexp and a syntax-propertize rule that only fires in operand position.
| Component | Detail |
|---|---|
arb-mode.el | Major mode — syntax table (# comments, single/double string quotes, / as punctuation), font-lock keyword / widget / verb lists, /regex/ syntax-propertize, arb-indent-line, arb-run-buffer (C-c C-c), eldoc + completion, eglot + lsp-mode registration, auto-mode-alist + interpreter-mode-alist. |
arb-stdlib.el | Query-verb / widget / directive signatures (from arb's LSP corpus) for eldoc and completion. Byte-compiles cleanly; loads instantly. |
scripts/face-test.el | Fontify a sample spec and assert the face at each probe token. |
arb --lsp | Launched with only --lsp; an appended --stdio is rejected by the binary, so neither client adds one. |
$VERIFICATION
CI byte-compiles the package with byte-compile-error-on-warn (warnings are errors) and runs the batch face test. Each probe asserts the actual face text-property after font-lock-ensure.
| Sample token | Asserted face |
|---|---|
text / gauge | arb-widget-face |
source / out / bind / fn | font-lock-keyword-face |
where / field / tally / count | font-lock-builtin-face |
in.json | font-lock-type-face |
quit (action) | font-lock-type-face |
pct (user function name) | font-lock-function-name-face |