Draw a walk's rows and variants through pathDraws, off the pin set and the walk's signature

This commit is contained in:
2026-09-24 13:11:12 +02:00
committed by Lillem4n
parent c77a2e2c93
commit 9cbd8841fe
12 changed files with 110 additions and 100 deletions
+9 -9
View File
@@ -273,11 +273,11 @@ func fieldTokens(format string) []string {
// tail is what makes the arm a bound draw: its head is drawn once per expansion
// (see compileOps).
type arm struct {
name string // as written, for messages
key string
tail []string
steps []string // key per level passed through; the head and leaf hold their own
path string // key and tail, the one spelling every way of writing this read shares
name string // as written, for messages
key string
tail []string
levels []string // the key at each level the tail passes through, the head's first
path string // key and tail, the one spelling every way of writing this read shares
}
// splitArm splits one name into key and tail. refs maps a reference to what
@@ -302,11 +302,11 @@ func splitArm(name string, refs map[string]refBinding) arm {
}
func pathArm(name, key string, segs []string) arm {
var steps []string
for i := 0; i < len(segs)-1; i++ { // every level except the leaf's own
steps = append(steps, key+"."+strings.Join(segs[:i+1], "."))
levels := []string{key}
for i := 0; i < len(segs)-1; i++ {
levels = append(levels, key+"."+strings.Join(segs[:i+1], "."))
}
return arm{name: name, key: key, tail: segs, steps: steps, path: key + "." + strings.Join(segs, ".")}
return arm{name: name, key: key, tail: segs, levels: levels, path: key + "." + strings.Join(segs, ".")}
}
// splitArms splits a token body's '|' alternatives.