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 } [ "," ] ")".
CellDecl
cell_decl = "cell" identifier cell_type_init [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".
CellFilter
cell_filter = "filter" expression.
ConditionalBranch
conditional_branch = literal_pattern "=>" "{" { relationship_decl } "}" [ "," ]. 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.
OutDecl
out_decl = "out" identifier [ ":" type_expr ] ":=" expression [ cell_filter ] [ "require" "{" { requirement } "}" ] ";".
RelationshipDecl
relationship_decl = "relationship" "{" { binding } "}".
RequireBlock
The optional require { ... } block trailing an out declaration’s initializer.
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 } "}" ] ";".

Enums§

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.
SheetItem
One top-level item inside a sheet { ... } body.
TypeExpr
type_expr = identifier | "(" [ type_expr ["," [ type_expr { "," type_expr } ]] ] ")".