Skip to documentation
SLOP

tiny.syn.highlight

Reference tiny.syn highlight

Defined in scan.line.

Marks up one line from a fresh continuation state.

Called byCallsNo direct callersscan.linehighlightLinescan.linehighlight
Static calls · unresolved targets: 0 · external targets: 0.

Source

Source: lib/syn/src/scan/line.zig:44

zig
/// Marks up one line from a fresh continuation state. A caller with one line on its own, such as a/// snippet or the README example, marks it up without keeping anything between calls. The function/// behaves as `highlightLine` with a new `State` that is dropped after the call, so a comment or/// string the line leaves open is forgotten. The call replaces the spans the storage held for the/// previous line. The storage must be activated before the call, and the call allocates nothing./// The call returns `.complete` when the spans were kept and `.discarded` when the line was longer/// than the text limit.pub fn highlight(    language: Language,    text: []const u8,    spans: *SpanStorage,) syn.SpanMaterialization {    var state: State = .{};    return highlightLine(language, text, &state, spans);}

Source: lib/syn/src/root.zig:58

zig
pub const highlight = scan.highlight;

Also reachable as

scan.highlight.

Audit

Definitions1
Public names3
Members0
Version26.7.0
Revisiondaab053ee433