Skip to main content

Module expr_arena

Module expr_arena 

Source

Structs§

ExprArena
Owns all ExprNodes and ArmPatternNodes for a single compiled Rib expression. Children are referenced by index, never by pointer.
ExprNode
A single expression node stripped of its inferred type. Child expressions are referenced by ExprId rather than owned.
MatchArmNode
TypeTable

Enums§

ArmPatternNode
CallTypeNode
Arena-friendly version of CallType. InstanceIdentifier embeds Option<Box<Expr>> for the worker name; we replace that with Option<ExprId>.
ExprKind
The shape of an expression node.
This mirrors Expr exactly, replacing every Box<Expr> / Vec<Expr> with ExprId / Vec<ExprId> and every ArmPattern with ArmPatternId.
InstanceCreationNode
InstanceIdentifierNode
RangeKind
Arena-friendly version of Range.
ResultExprKind
Arena-friendly version of Result<Box<Expr>, Box<Expr>> in Expr::Result.

Functions§

lower
Lower the recursive Expr tree into an arena representation.
lower_into
Lower expr into an existing arena, allocating fresh ExprIds and wiring child pointers within arena only (unlike naïvely cloning nodes from a separate lowered arena, which would leave stale child ids).
rebuild_expr
Reconstruct a full Expr tree from the arena, applying the current TypeTable values. This is the inverse of lower and handles structural mutations (e.g. InvokeMethodLazyCall) that occurred during arena-based inference.

Type Aliases§

ArmPatternId
Stable index into the arm-pattern arena.
ExprId
Stable index into ExprArena identifying a single expression node.