DSMSourceSpan

class dsviper.DSMSourceSpan

Bases: object

A source span: a 1-based line in the assembled content, and the [start, stop] offsets into the content the builder assembled.

start counts from 0 and stop is inclusive - it is the offset of the last character, not the one past it. An offset counts Unicode code points, not bytes: content[start:stop + 1] slices the span.

Note: Not directly instantiable.

line() → int

Return the 1-based line number of the span, in the assembled content.

start() → int

Return the start code point offset (inclusive, 0-based) in the assembled content.

stop() → int

Return the stop code point offset (inclusive) in the assembled content.