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
@@ -165,10 +165,7 @@ func renderEdges(n node) []renderEdge {
// already proved the tail resolves in every variant.
func pathLeaves(n node, tail []string) []node {
var out []node
_, _ = walkPath(n, tail, pathWalk{
choice: func(c *choice, _ []string) ([]node, error) { return c.items, nil },
leaf: func(n node) error { out = append(out, n); return nil },
})
_, _ = walkPath(n, tail, pathWalk{mode: walkEvery, pins: &pinSet{}, leaf: func(n node) error { out = append(out, n); return nil }})
return out
}