pub enum Binding {
Leaf(Expr),
Group(GroupPlan),
Inherit,
InheritFrom {
from: usize,
},
}Expand description
A binding after normalization.
Variants§
Leaf(Expr)
A value that is NOT a syntactic attrset literal, so it can never merge.
Group(GroupPlan)
A syntactic attrset literal, or an implicit one created by a dotted path. Mergeable — and merging splices into THIS node.
Inherit
inherit x — resolve x in the group’s ENCLOSING scope, never its own
rec scope. That is what makes an inherited binding shadow rather than
self-reference, and why it can never merge.
InheritFrom
inherit (e) x — force GroupPlan::inherit_froms[from], then select.
★ An INDEX, not a cloned expression. One inherit (e) a b c; clause
must evaluate e AT MOST ONCE and share the result across all three
names; cloning the expr per name evaluates it three times, which is
observable through builtins.trace and through any impure source. The
index is per-GROUP because the splice moves a clause between groups.
Fields
from: usizeIndex into the owning GroupPlan::inherit_froms.