Expand description
Lexer and token/trivia types for Daml source text. 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§
- Byte
Offset - Parser byte offset into the original UTF-8 source.
- Byte
Span - Byte span into the original UTF-8 source.
- Identifier
- A small, deliberately unchecked domain type for parser identifier-like text.
- LexError
- A lexical error. The scan must survive these: the caller reports the diagnostic and works with the tokens produced so far.
- LexOutput
- LexWith
Trivia Output - Module
Name - A small, deliberately unchecked domain type for module-style qualified names
(
DA.Map,Daml.Foo). - Operator
- A small, deliberately unchecked domain type for symbolic operator text.
- Pos
- 1-based source position of a token’s first character.
- Token
- Trivia
Enums§
- LexError
Kind - Render
Lossless Error - Token
Kind - Token category plus normalized token payload.
- Trivia
Kind - Source text the lexer consumes but the parser never sees.
Functions§
- lex
- Lex
sourceinto tokens and lexical errors only. - lex_
with_ trivia - Lex
sourceinto tokens, trivia, and lexical errors. - render_
lossless - Reconstruct the source from token and trivia spans.