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§
- Assert
Entry - An assert declaration with lowered body.
- Body
Source - Where a merged declaration body’s spans index into (#868).
- Const
Entry - A const declaration with type annotation and lowered body.
- DagBody
Self Imports - Result of
preprocess_dag_body_self_imports: imported names, declared types, source bindings, and the body with self-import declarations stripped. - Figure
Entry - A figure declaration with lowered fields.
- IR
- Intermediate Representation produced by
lower. - Imported
Value Source - Runtime source of an imported value visible inside a DAG body.
- Included
Plot Entry - A plot alias brought into this DAG by an include brace list (#847).
- Layer
Entry - A layer declaration with lowered fields.
- Lowered
Plot Body - One plot declaration’s expressions lowered to HIR, in source order.
- Lowered
Plot Field - A named plot/figure/layer field expression lowered to HIR.
- Node
Entry - A node declaration with type annotation and lowered body.
- Param
Entry - A param declaration with type annotation and lowered default.
- Plot
Entry - A plot declaration with lowered body.
- Requested
Plot - A plot requested by an include brace list item (#847).
- Selected
Declarations - Names selected from a dependency’s type-system registry.
- Unfrozen
Assert Entry - An assert declaration awaiting body lowering at
UnfrozenIR::freeze. - Unfrozen
Const Entry - A const declaration awaiting body lowering at
UnfrozenIR::freeze. - Unfrozen
Figure Entry - A figure declaration awaiting field lowering at
UnfrozenIR::freeze. - UnfrozenIR
- An IR without a frozen registry, awaiting a call to
freeze. - Unfrozen
Layer Entry - A layer declaration awaiting field lowering at
UnfrozenIR::freeze. - Unfrozen
Node Entry - A node declaration awaiting body lowering at
UnfrozenIR::freeze. - Unfrozen
Param Entry - A param declaration awaiting default lowering at
UnfrozenIR::freeze. - Unfrozen
Plot Entry - 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
RegistryBuilderthat 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§
- Registry
Seed - Hook that merges imported type-system declarations into the registry builder.