Skip to main content

Module ast

Module ast 

Source
Expand description

A span-carrying CEL expression AST, built by AstContext as an alternative to DynSegmentContext’s direct execution. Consumed as-is by adam-lang (method bodies/initializers), the language server, the formatter, and the future macro-compilation backend. Carries no resolved types or operator overloads: resolution and type/range validation are deferred to a later, separate phase.

Array nodes preserve optional recursive type ascriptions exactly as written — for example [0, 1]: [i32], []: [[i32]], or []: [Custom] — using unresolved TypeExpr leaves so a later checker can resolve names through built-in CEL types or a host registry. Recursive tuple, array, and callable types compose without per-shape host registrations.

Structs§

AstContext
ParserContext implementation that builds a span-carrying Expr tree instead of executing. Consults no OpLookup, inspects no runtime types, and never fails on semantic grounds — resolution and type/range checking are deferred to a later, separate type-checking phase (see the module doc comment).
ClosureParam
One closure_param = identifier ":" type_expression — a closure literal’s declared parameter.
ExprSpan
Source range of an AST node: start of its first token to end of its last.
RecordInit
One required record field initializer, retaining its written name, span, and value.

Enums§

Expr
A parsed CEL expression with source spans on every node.
Literal
A CEL literal, one variant per concrete Rust type crate::ParserContext::push_literal can receive from push_literal_token in lib.rs.
LogicalOp
The two short-circuiting logical operators.