ReadonlyendZero-based end offset (exclusive). Not always position + value.length —
braced variables (@{name} stores only name) and case-normalized
identifiers consume more input than their value retains.
ReadonlypositionZero-based start offset in the input string (UTF-16 code units)
ReadonlytypeThe type of this token
ReadonlyvalueThe raw string value from input (lowercased for identifiers)
A token produced by lex: what it is, the text it came from, and where in the input that text sits.
position/endare a half-open range, soinput.slice(position, end)recovers the original source text — useful for syntax highlighting, wherevaluealone is lossy.Example