Name pathWalk's modes, and draw a path only through drawPath once it is proved

This commit is contained in:
2026-09-25 08:03:48 +02:00
committed by Lillem4n
parent ed909dcf63
commit 5953c58224
7 changed files with 61 additions and 64 deletions
+1 -4
View File
@@ -100,10 +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{
choice: func(c *choice, _ []string) ([]node, error) { cover(c, into, false); return nil, nil },
leaf: func(n node) error { cover(n, into, false); return nil },
})
_, _ = walkPath(n, tail, pathWalk{mode: walkCover, leaf: func(n node) error { cover(n, into, false); return nil }})
}
// cover collects a level and everything contained in it. A fixed string outside a