tiny.syn.span
Defined in tiny.syn.
The namespace holds what a scan produces: the marked byte ranges of a line, the buffer that receives them, and the arithmetic that sizes that buffer.
API (11)
Types and contracts
Public types and contracts.
Capacity: The sizes that follow from oneLimitsvalue, computed without allocating.DeriveError: The one way sizing can fail.Kind: The role of the text one span covers.Limits: The one limit the caller chooses for span storage.Materialization: What happened to the spans of one line.Span: One marked byte range of a line and its role.Status: A caller reads it fromStorage.statusto check sizes and to count dropped lines, as the README example and the tests do.Storage: A caller creates one before scanning and passes it to everyhighlightandhighlightLinecall.
Namespaces
Public namespaces.
capacity: The arithmetic computes, from one limit the caller chooses, how many bytes the storage for a line's marks needs.model: A scan produces marked byte ranges for one line, each with the role of the text it covers, and whether the marks of the line were kept.storage: The buffer that receives the marks of each line: one region, allocated when the buffer is created, freed when it is destroyed, and reused for every line in between.
Source
Source: lib/syn/src/root.zig:39
zig
pub const span = @import("span/root.zig");Source: lib/syn/src/span/root.zig
zig
//! The namespace holds what a scan produces: the marked byte ranges of a line, the buffer that//! receives them, and the arithmetic that sizes that buffer. A caller needs to know before it scans//! anything how much memory the marks of its longest line take, and then needs the marks of each//! line in a buffer it can read.//!//! Each marked range (*span*) carries its role with it, as a start byte, an end byte and a kind, so//! a renderer picks colors without scanning again. The buffer (*span storage*) is allocated once//! from a limit on line length, and every later line reuses it.pub const capacity = @import("capacity.zig");pub const model = @import("model.zig");pub const storage = @import("storage.zig");pub const Capacity = capacity.Capacity;pub const Limits = capacity.Limits;pub const DeriveError = capacity.DeriveError;pub const Kind = model.Kind;pub const Materialization = model.Materialization;pub const Span = model.Span;pub const Status = storage.Status;pub const Storage = storage.Storage;Audit
| Definitions | 1 |
|---|---|
| Public names | 1 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |