Compile each path's steps, leaves and cover once at link, deleting pathCover, coverPath and pathLeaves

This commit is contained in:
2026-09-30 17:09:50 +02:00
committed by Lillem4n
parent 0f58784a1b
commit 6b9755b3ef
10 changed files with 149 additions and 103 deletions
+1 -7
View File
@@ -53,7 +53,7 @@ func heldNodes(t *template, name string, readers []reader) map[node]bool {
}
for _, r := range readers {
if r.a.head == name {
coverPath(t.head(name), r.a.tail, held)
cover(r.a.cover, held, false)
}
}
return held
@@ -97,12 +97,6 @@ func operandReader(t *template, name string) (call, operand string) {
return "", ""
}
// coverPath collects what holding one path pins: the first choice level it passes,
// whole, else the leaf it renders; it reads no row.
func coverPath(n node, tail []string, into map[node]bool) {
_, _ = (&pathCover{into: into}).walk(n, tail)
}
// cover collects a level and everything contained in it. A fixed string outside a
// choice is left out — it cannot disagree with itself — but inside one each
// variant carries its own, so there it counts.