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 dispatch point used by the compiler’s
compile_binding to turn a parsed call expression into a Box<dyn PolydatNode>.
ConstArg captures assembly-time constant arguments extracted from the AST.
Dispatch is decentralized: each node module exposes its own build_node
function returning Option<Result<...>>. The top-level build_node here
tries each module in turn and falls back to the registry for variadic nodes.
Modules§
- compile_
ctx - Source-binding attribution, set by the compiler before each
build_nodecall and read by factories that want to record which DSL binding caused the node to exist. Thecontrol_setfactory is the canonical consumer:rate_adj := control_set("rate", target)calls the factory withcurrent_binding()returning"rate_adj", which the node stores for runtime attribution inControlOrigin::Polydat { binding }.
Enums§
- Const
Arg - Constant arguments extracted from the AST.
Functions§
- build_
node - Build the node
functakes for the given wires, their types, and constant arguments, through the registry; an unknown function or a mismatched signature is an error naming it.