Name the inline drawGroup refusal as a binding's reference fence, beside the cycle fence

This commit is contained in:
2026-09-28 10:37:26 +02:00
committed by Lillem4n
parent 224cf12fdd
commit 01a60d06f1
3 changed files with 19 additions and 24 deletions
+9 -8
View File
@@ -146,17 +146,18 @@ func inputValue(input string) (any, error) {
return raw, nil
}
// inlineBinding binds an inline node against root, naming its nodes from label.
func inlineBinding(n node, label string, root map[string]node) binding {
scope := inlineScope(n, label)
return binding{scope: scope, link: func() error { return linkInline(n, label, scope, root) }}
}
func linkInline(n node, label string, scope nodeScope, root map[string]node) error {
if t, isTemplate := n.(*template); isTemplate && t.drawGroup != "" {
return fmt.Errorf("%s: drawGroup %q names nothing, since nothing can reference an inline template; drop it", label, t.drawGroup)
return binding{
scope: scope,
link: func() error { return linkNodeRefs(scope, root) },
referenceFence: func() error {
if t, isTemplate := n.(*template); isTemplate && t.drawGroup != "" {
return fmt.Errorf("%s: drawGroup %q names nothing, since nothing can reference an inline template; drop it", label, t.drawGroup)
}
return nil
},
}
return linkNodeRefs(scope, root)
}
// linkNodeRefs binds the references in an inline node's templates against the