Name the path walks after their entry points, keep the probe allocation-free, and record why the walks are four loops

This commit is contained in:
2026-09-28 00:26:33 +02:00
committed by Lillem4n
parent 917c93564f
commit 68033bd42f
8 changed files with 35 additions and 29 deletions
+2 -2
View File
@@ -44,10 +44,10 @@ func (f *Generator) Fake(path string) (string, error) {
// every call.
func descend(s *session, root node, segments []string, sc renderScope) (node, error) {
// Walked once without drawing first, so a path that fails moves no seeded stream.
if _, err := (&probeWalk{}).walk(root, segments); err != nil {
if _, err := (&pathProbe{drawn: map[*table]bool{}}).walk(root, segments); err != nil {
return nil, err
}
return drawPath(root, segments, "", &renderWalk{s: s, pins: &sc.hold().pins}), nil
return drawPath(root, segments, "", &pathDraw{s: s, pins: &sc.hold().pins}), nil
}
// render evaluates a compiled node to a string. compile validates every node up