Hecr::Compiler::ExprScanner
Boundary detection and validation for Crystal expressions embedded in
templates, built on Crystal's OWN lexer/parser (spike 05). Brace matching
is therefore correct for all of Crystal's syntax: strings containing
braces, string interpolation, %-literals, char literals, nested braces.
(HEEx uses naive depth counting and breaks on {"}"}.)
Instance methods
source begins right AFTER the opening {. Returns the byte offset
(within source) of the matching }.
Splits a :for value of the form pattern <- enumerable at the first
top-level <-. Returns {pattern, enumerable} or nil when there is no
generator arrow. <- is hecr dialect syntax (not Crystal), so the
split happens token-wise: an OP < immediately followed (byte-adjacent)
by an OP - at bracket depth zero.