Skip to main content

Module lexer

Module lexer 

Source
Expand description

DAML lexer: source text → tokens with spans.

First stage of the real parser pipeline (lexer → layout → parse). Comments (line --, nested block {- -}) and string/char literals are resolved here, so no later stage can ever mistake -- exercise the option for a ledger action.

Structs§

LexError
A lexical error. The scan must survive these: the caller reports the diagnostic and works with the tokens produced so far.
Pos
1-based source position of a token’s first character.
Token
Trivia

Enums§

Tok
TriviaKind
Source text the lexer consumes but the parser never sees.

Functions§

lex
lex_with_trivia
render_lossless
Reconstruct the source from token and trivia spans.