Skip to main content

Module syntax

Module syntax 

Expand description

The toolkit’s grammar-backed Highlighter: a [tilo_highlight] grammar set (syntect over two-face’s grammars), each span’s scope mapped to one TokenKind; colours stay with the renderer and the OS Theme, never with a syntect colour theme.

The grammar set is not part of the shared runtime every app maps: with lazy-highlight (the runtime’s build, turned on by the engine library’s own build) it comes from libtilo_highlight_engine.so, opened the first time code is highlighted; otherwise it is linked (tilo-highlight-grammars). If the library does not open, code highlights as plain text.

Structs§

SyntaxHighlighter
A grammar-backed Highlighter for one language.
SyntaxState
A grammar’s parse position between two lines: everything multi-line constructs (block comments, strings, heredocs) need to continue.