Skip to content

Tokens and locations

token_kind controls how the lexer exposes a token:

token_kindnext_tokeneach_token
:array[type, value]Yields one array
:structFlexr::Runtime::TokenYields a token
:yieldAdapter-definedYields type, value

Locations use byte offsets for the input position and track line/column as the lexer consumes text. Keep the location with the token when a parser needs useful syntax errors.

For exact defaults and the Location data structure, use the repository’s tokens and locations reference.