Skip to content

Span

A region of source text: where it starts, and its length in characters.

The length counts each line break the span crosses, so where a span ends is known only with the source: Unit.end gives it, and Unit.text slices it.

Spans order by start, then by length, so they can be sorted or used as dict keys.

Fields

len @ Int [get]

The length in characters.

start @ Pos [get]

The inclusive start position.