Span

data class Span(val type: TokenType, val start: Int, val end: Int)

A half-open source range [start, end) annotated with a TokenType.

start and end are zero-based indices into the flat character sequence that was parsed. The range covers exactly the characters that the parser consumed to produce this token.

Constructors

Link copied to clipboard
constructor(type: TokenType, start: Int, end: Int)

Properties

Link copied to clipboard
val end: Int

the index one past the last character (exclusive).

Link copied to clipboard
val start: Int

the index of the first character (inclusive).

Link copied to clipboard

the semantic type of this span.