Skip to main content

Module factory

Module factory 

Source
Expand description

External-facing factory module. Made pub (was pub(crate)) so crates that host polydat nodes outside the polydat crate (host runtimes) can reach ConstArg, compile_ctx, and build_node from their register_nodes! invocations. Node factory: maps Polydat function names to runtime node instances.

build_node is the single construction point: the compiler turns every call expression into a Box<dyn PolydatNode> through it, and it builds through the NodeFactory that owns the function name. ConstArg captures assembly-time constant arguments extracted from the AST.

Structs§

BuildContext
What the compiler tells a node factory about the node it is building: the bindings under construction when the node was asked for, and the program tree’s resource scope.

Enums§

ConstArg
Constant arguments extracted from the AST.

Functions§

build_node
Build the node func takes for the given wires, their types, and constant arguments, through the registry; an unknown function or a mismatched signature is an error naming it. ctx reaches the factory unchanged.