Expand description
A span-carrying adam-lang structural AST, built by crate::AdamAstParser as an alternative to
crate::AdamParser’s direct adam_rs::Sheet construction. Method bodies and cell
initializers reference [cel_parser::Expr]/[cel_parser::lex_lexer::Literal] directly.
Carries no resolved types, no TypeRegistry lookups, and never fails on semantic grounds
(unknown type name, literal/type mismatch, undeclared cell, arity mismatch) — those checks
are deferred to a later, separate compile-to-Sheet phase, mirroring
[cel_parser::AstContext]’s design.
Structs§
- Binding
Decl binding = binding_target ":=" expression ";".binding_target = identifier | "(" identifier "," [ identifier { "," identifier } ] ")".- Cell
Decl cell_decl = "cell" identifier cell_type_init [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".- Cell
Filter cell_filter = "filter" expression.- Conditional
Branch conditional_branch = literal_pattern "=>" "{" { relationship_item } "}".literal_pattern = ["-"] literal.- Conditional
Decl conditional_decl = "conditional" expression "{" { conditional_branch } "}".- Default
Branch - The
_ => { ... }default branch of aconditional_decl, mirroringConditionalBranch’s shape (it has no match literal of its own). - Expr
Span - Source range of an AST node: start of its first token to end of its last.
- Module
- An ordered file of imports and sheet definitions, without resolved names or types.
- Named
Argument - A named binding from a formal parameter to a caller’s cell identifier.
- OutDecl
out_decl = "out" identifier [ ":" type_expr ] ":=" expression [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".- Parameter
Decl - A required typed formal parameter, without a default or an initializer.
- Relationship
Decl relationship_decl = "relationship" "{" { binding } "}".- Relationship
Use relationship_use = "relationship" path "(" [ named_arguments ] ")" ";".- Require
Block - An optional
require { ... }block on a cell, source or output declaration. - Requirement
Decl requirement = [ "@" identifier ] expression ";".- Sheet
- A parsed adam-lang sheet declaration, with source spans on every node.
- Source
Decl source_decl = "source" identifier cell_type_init [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".- UseDecl
use_decl = "use" identifier { "::" identifier } [ "as" identifier ] ";".
Enums§
- Branch
Item - A conditional branch item, retaining inline and included relationship order.
- Comment
- A recovered
////* */comment, remembering which delimiter style the source used so a formatter can reproduce it instead of normalizing every comment to one style. - Module
Item - A file-level declaration or a recovered malformed declaration.
- Sheet
Item - One top-level item inside a
sheet { ... }body. - Type
Expr - Re-exports CEL’s shared named, generic, tuple, array, and callable type expressions.