Skip to main content

Module compile_ctx

Module compile_ctx 

Source
Expand description

Source-binding attribution, set by the compiler before each build_node call and read by factories that want to record which DSL binding caused the node to exist. The control_set factory is the canonical consumer: rate_adj := control_set("rate", target) calls the factory with current_binding() returning "rate_adj", which the node stores for runtime attribution in ControlOrigin::Polydat { binding }.

Structs§

BindingScope
RAII guard that clears the binding slot on drop.

Functions§

current_binding
Read the current binding attribution. Returns None when called outside a scoped_binding scope (e.g. ad-hoc tests that call super::build_node directly).
scoped_binding
Install the current binding name for the duration of a single build_node call. Returns a guard that clears the thread-local on drop so nested compilation can’t leak attribution across callers.