Split walkPath's four modes into walkers of their own, sharing how a path steps

This commit is contained in:
2026-09-28 00:19:43 +02:00
committed by Lillem4n
parent 9126e0e07d
commit 94eb7aa81f
7 changed files with 261 additions and 187 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ func operandReader(t *template, head string) string {
// coverPath collects what holding one path pins: every choice level the path
// passes through, whole, and the leaf it renders.
func coverPath(n node, tail []string, into map[node]bool) {
_, _ = walkPath(n, tail, pathWalk{mode: walkCover, leaf: func(n node) error { cover(n, into, false); return nil }})
_, _ = (&coverWalk{into: into}).walk(n, tail)
}
// cover collects a level and everything contained in it. A fixed string outside a