Turns one line of source into styled io.worxbend.tui.core.Spans — the open extension point behind SyntaxHighlighter, a Markdown fence and TextAreaOptions.lexer.
Highlighting is line-oriented, with a LexState carried from the end of one line to the start of the next: the three-argument highlightLine takes the state the previous line ended in and answers the state this one ends in, so a block comment, a triple-quoted string or a YAML block scalar that spans lines is highlighted on every line it covers. highlight threads it through a whole text, and so do a Markdown fence and a TextArea. The two-argument form lexes one line on its own, from LexState.Initial; a lexer that keeps no state implements only that one, and the stateful form defaults to it. The spans of the returned Line must concatenate back to line exactly — an editor maps them onto its grapheme clusters, and a lexer that drops or adds characters has its styling ignored there.
Implementations are immutable values and safe to share between threads; aliases are the lower-case info-string names ( ```yaml) a Markdown fence resolves through Lexer.among.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any