Skip to main content

Module schema_lower

Module schema_lower 

Source
Expand description

relon_analyzer::SchemaDef -> crate::schema_canonical::Schema conversion.

The wasm AOT backend needs a deterministic, ABI-shaped view of a schema so it can compute the same relon.abi hash both at codegen time (host side) and at validation time (wasm-blob loader). The analyzer’s SchemaDef is the static skeleton the rest of the pipeline reasons about; this module strips it down to the field (name, type) pairs the binary layout cares about.

Phase 2.b scope: only Int / Float / Bool field types are supported by lower_schema_def; the function is used to lower the synthesised MainParams schema. Pointer-indirect leaves (String, List<Int>) and nested branded schemas are constructed directly inside the IR lowering pass (it has access to the analyzer’s schema table for cross-schema resolution).

Enums§

SchemaLowerError
Reasons schema lowering can fail.

Functions§

lower_schema_def
Lower a SchemaDef to its canonical Schema form.
lower_type_node
Lower a single TypeNode to a TypeRepr. Rejects every composite / variable-size type — see SchemaLowerError.