Link each template in steps that each return what they build, create a name scope with its owner in one place, and settle each record's columns at load, so Generator.records goes

This commit is contained in:
2026-10-05 22:21:10 +02:00
committed by Lillem4n
parent cdc82a99c6
commit cd7f0a04dc
16 changed files with 339 additions and 313 deletions
+4 -14
View File
@@ -122,26 +122,16 @@ func refuseFolderRefs(scope nodeScope) error {
})
}
// linkNodeRefs binds the references in an inline node's templates against the
// loaded tree.
// linkNodeRefs links the templates of an inline node against the loaded tree.
func linkNodeRefs(scope nodeScope, root map[string]node) error {
var ts []linkSite
if err := scope(func(label string, m node) error {
if t, ok := m.(*template); ok {
return linkTemplate(nil, label, "", t, root)
ts = append(ts, linkSite{t: t, label: label})
}
return nil
}); err != nil {
return err
}
for _, pass := range linkPasses {
if err := scope(func(label string, m node) error {
if t, ok := m.(*template); ok {
return pass(label, t)
}
return nil
}); err != nil {
return err
}
}
return nil
return linkTemplates(ts, root)
}