Skip to main content

Module ast

Module ast 

Source
Expand description

Abstract syntax tree for Jetro v2 expressions.

The AST is the contract between the parser and every other v2 layer — the compiler lowers it to opcodes, analyses inspect it for ident-use / purity, and tests build it directly. Because every component observes Expr, its variants are kept deliberately orthogonal: each is a language concept, not an implementation shortcut.

Arc<str> is used for every identifier so that cloning a name into an opcode is a refcount bump rather than a byte copy. Recursive sub-expressions are Box<Expr> — owned, not shared — since the compiler rewrites the AST in-place (see reorder_and_operands).

Structs§

PatchOp
SortKey

Enums§

Arg
ArrayElem
BinOp
BindTarget
CastType
Expr
FStringPart
FmtSpec
KindType
ObjField
PathStep
PipeStep
QuantifierKind
Step

Type Aliases§

ExprRef
Shared reference to an expression (for lambdas stored in closures).