Module highlight

Module highlight 

Source
Expand description

Syntax highlighting and bracket validation for the narju REPL.

Structs§

NarjuHelper
The rustyline helper for the raw λ↑↓ REPL: syntax highlighting, filename completion (for :load), history hints, and bracket validation.
NarjuHelperLite
The rustyline helper for the Purple REPL: highlighting and bracket validation only. See the comment block above for why completion and hinting are stubbed out.

Constants§

KEYWORDS
Surface forms rendered in the keyword colour.

Functions§

highlight_sexp
Render src with ANSI colours: keywords, literals, numbers, comments, quotes, and brackets each get their own colour.
is_sym_char
Whether c can appear in a symbol, for tokenising during highlighting. Mirrors the reader’s symbol alphabet (crate::parse); the two must agree or highlighting splits tokens differently than the reader does.
validate_brackets
Bracket-balance validator — waits for balanced parens before submitting.