Skip to main content

Module ast

Module ast 

Source
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§

BindingDecl
binding = binding_target ":=" expression ";". binding_target = identifier | "(" identifier "," [ identifier { "," identifier } ] ")".
CellDecl
cell_decl = "cell" identifier cell_type_init [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".
CellFilter
cell_filter = "filter" expression.
ConditionalBranch
conditional_branch = literal_pattern "=>" "{" { relationship_item } "}". literal_pattern = ["-"] literal.
ConditionalDecl
conditional_decl = "conditional" expression "{" { conditional_branch } "}".
DefaultBranch
The _ => { ... } default branch of a conditional_decl, mirroring ConditionalBranch’s shape (it has no match literal of its own).
ExprSpan
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.
NamedArgument
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 } "}" ] ";".
ParameterDecl
A required typed formal parameter, without a default or an initializer.
RelationshipDecl
relationship_decl = "relationship" "{" { binding } "}".
RelationshipUse
relationship_use = "relationship" path "(" [ named_arguments ] ")" ";".
RequireBlock
An optional require { ... } block on a cell, source or output declaration.
RequirementDecl
requirement = [ "@" identifier ] expression ";".
Sheet
A parsed adam-lang sheet declaration, with source spans on every node.
SourceDecl
source_decl = "source" identifier cell_type_init [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".
UseDecl
use_decl = "use" identifier { "::" identifier } [ "as" identifier ] ";".

Enums§

BranchItem
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.
ModuleItem
A file-level declaration or a recovered malformed declaration.
SheetItem
One top-level item inside a sheet { ... } body.
TypeExpr
Re-exports CEL’s shared named, generic, tuple, array, and callable type expressions.