Expand description
Lossless AST node types produced by the parser. Typed, lossless parse tree produced by the recursive-descent parser (src/parse.rs).
Declarations, expressions, patterns, and most parser DTOs carry both a
1-based source Pos for their first token and a byte Span for their
full source extent. Type nodes carry spans only because downstream
consumers slice type source text but do not currently need line/column
anchors per type fragment. Downstream crates consume this tree directly:
daml-fmt re-prints layout from the spans, and daml-lint lowers it onto its
own rule-facing IR.
Parser-created trees are the supported construction path. Public fields are
exposed so tools can match the tree directly; vectors preserve source order,
pos is the first token’s position, and span is the half-open byte range
covering the node’s real source tokens.
Re-exports§
pub use crate::lexer::ByteOffset;pub use crate::lexer::Identifier;pub use crate::lexer::ModuleName;pub use crate::lexer::Operator;pub use crate::lexer::Pos;
Structs§
- Alt
- Binding
- Choice
Decl - Equation
- Field
Decl - Fixity
Decl - Top-level fixity declaration (
infix[l|r]? n op [, op ...]). - Function
Decl - Import
Decl - Interface
Decl - Interface
Instance Decl - Module
- Parse
Diagnostic - Parse diagnostic — never fatal under tolerant parsing.
- Span
- Byte span of an AST node.
- Template
Decl
Enums§
- Consuming
- Decl
- Diagnostic
Category - Why a
ParseDiagnosticfired. - DoStmt
- Expected
Token - Expected token or token class for a recoverable parser diagnostic.
- Expr
- Field
Assign - Fixity
Assoc - Fixity associativity keyword (
infix,infixl,infixr). - Fixity
Target - Operator or backtick-quoted name in a fixity declaration.
- Import
Style - Import syntax style.
- LitKind
- Malformed
Syntax Kind - Recoverable malformed syntax cases that are not just missing one token.
- Parse
Diagnostic Kind - Machine-readable reason a
ParseDiagnosticfired. - Pat
- Skipped
Declaration Reason - Why a whole declaration was skipped.
- Template
Body Decl - Type
- Structured Daml type, parsed from the real token stream.
- Type
Annotation - Type
Annotation Context - The declaration context whose type annotation was malformed.
- Unsupported
Syntax Kind - Unsupported syntax families surfaced by the parser.