Skip to main content

Module registry

Module registry 

Source
Expand description

Type registry for tracking user-defined types during parsing.

The registry stores type definitions discovered during the discovery pass and provides lookup during parsing and code generation. It supports:

  • Primitives: Nat, Int, Text, Bool (built-in)
  • Structs: Named records with typed fields
  • Enums: Sum types with variants (unit or tuple)
  • Generics: Parameterized types (List of T, Pair of T and U)

The registry is populated by super::DiscoveryPass before main parsing begins.

Structs§

FieldDef
Field definition within a struct
TypeRegistry
VariantDef
Phase 33: Variant definition for sum types

Enums§

FieldType
Type reference for struct fields (avoids circular deps with ast::TypeExpr)
TypeDef

Constants§

BUILTIN_STRUCT_NAMES
The structs the compiler hands to author code fully formed, rather than one an ## An X has: declaration writes — the one list TypeRegistry::with_primitives registers them from and TypeRegistry::is_builtin_struct answers against, so a consumer never has to know their names itself. crates/logicaffeine_compile/src/vm/wasm/kind.rs’s builtin_struct_types() carries the same two shapes for the wasm backend’s own boundary-type resolution.

Functions§

builtin_generic_param_count
How many type parameters a BUILT-IN generic takes — the one table the whole compiler asks.