Skip to main content

Module lower

Module lower 

Source
Expand description

Intermediate Representation (IR) — the result of lowering an AST.

lower() combines declaration collection (resolve), registry construction (dimensions, units, indexes, structs), and function registration into a single IR value. Reference resolution happens at UnfrozenIR::freeze, which lowers every assembled declaration body to HIR — the frozen IR carries no syntax-AST expression.

Structs§

AssertEntry
An assert declaration with lowered body.
BodySource
Where a merged declaration body’s spans index into (#868).
ConstEntry
A const declaration with type annotation and lowered body.
DagBodySelfImports
Result of preprocess_dag_body_self_imports: imported names, declared types, source bindings, and the body with self-import declarations stripped.
FigureEntry
A figure declaration with lowered fields.
IR
Intermediate Representation produced by lower.
ImportedValueSource
Runtime source of an imported value visible inside a DAG body.
IncludedPlotEntry
A plot alias brought into this DAG by an include brace list (#847).
LayerEntry
A layer declaration with lowered fields.
LoweredPlotBody
One plot declaration’s expressions lowered to HIR, in source order.
LoweredPlotField
A named plot/figure/layer field expression lowered to HIR.
NodeEntry
A node declaration with type annotation and lowered body.
ParamEntry
A param declaration with type annotation and lowered default.
PlotEntry
A plot declaration with lowered body.
RequestedPlot
A plot requested by an include brace list item (#847).
SelectedDeclarations
Names selected from a dependency’s type-system registry.
UnfrozenAssertEntry
An assert declaration awaiting body lowering at UnfrozenIR::freeze.
UnfrozenConstEntry
A const declaration awaiting body lowering at UnfrozenIR::freeze.
UnfrozenFigureEntry
A figure declaration awaiting field lowering at UnfrozenIR::freeze.
UnfrozenIR
An IR without a frozen registry, awaiting a call to freeze.
UnfrozenLayerEntry
A layer declaration awaiting field lowering at UnfrozenIR::freeze.
UnfrozenNodeEntry
A node declaration awaiting body lowering at UnfrozenIR::freeze.
UnfrozenParamEntry
A param declaration awaiting default lowering at UnfrozenIR::freeze.
UnfrozenPlotEntry
A plot declaration awaiting body lowering at UnfrozenIR::freeze.

Functions§

lower
Lower an AST into an IR.
lower_dag_body_to_ir
lower_dag_module_to_builder_with_imported_value_decls
Lower a dag { ... } body as if it were a standalone file.
lower_to_builder_with_imported_value_decls
Lower an AST with imported value names plus declared types for imports whose runtime values will be supplied later.
lower_to_builder_with_imported_values
Lower an AST with pre-evaluated imported values, returning a RegistryBuilder that can be further mutated before freezing.
register_selected_declarations
Register only the named type-system declarations (dimensions, units, indexes, types) from a file into the registry.
substitute_type_expr_index_names
Rewrite index names within a type expression according to a binding map.
substitute_type_expr_nominal_names
Rewrite nominally-tied names (types or dimensions) within a type expression.

Type Aliases§

RegistrySeed
Hook that merges imported type-system declarations into the registry builder.