diff --git a/format.go b/format.go index 97d2704..415d80e 100644 --- a/format.go +++ b/format.go @@ -306,11 +306,12 @@ func checkNoRepeatedArm(body string, names []string) error { // is what makes the arm a held draw: its head is drawn once per expansion (see // compileOps). type arm struct { - spelling string // as written, for messages - head string - tail []string - levels []string // the path at each level the tail passes through, the head first - path string // head and tail, the one path every way of writing this read shares + spelling string // as written, for messages + head string + writtenHead string // head as written, sigil included + tail []string + levels []string // the path at each level the tail passes through, the head first + path string // head and tail, the one path every way of writing this read shares } // splitArm splits one name into head and tail. refs maps a reference to what @@ -325,21 +326,23 @@ func splitArm(name string, refs map[string]refBinding) arm { } return arm{spelling: name, head: head, path: head} } - return pathArm(name, b.head, b.tail) + sigil, rest, _ := refShape(name) // linkRefs proved it + written, _ := splitPath(rest) + return pathArm(name, b.head, sigil+joinSegments(written[:len(written)-len(b.tail)]), b.tail) } segs, err := splitPath(name) if err != nil || len(segs) == 1 { return arm{spelling: name, head: name, path: name} } - return pathArm(name, segs[0], segs[1:]) + return pathArm(name, segs[0], segs[0], segs[1:]) } -func pathArm(name, head string, segs []string) arm { +func pathArm(name, head, writtenHead string, segs []string) arm { levels := []string{head} for i := 0; i < len(segs)-1; i++ { levels = append(levels, head+"."+strings.Join(segs[:i+1], ".")) } - return arm{spelling: name, head: head, tail: segs, levels: levels, path: head + "." + strings.Join(segs, ".")} + return arm{spelling: name, head: head, writtenHead: writtenHead, tail: segs, levels: levels, path: head + "." + strings.Join(segs, ".")} } // checkSegments rejects an unfinished path: "{a.}" and "{a..b}" each have a diff --git a/path.go b/path.go index 4319091..b8b253f 100644 --- a/path.go +++ b/path.go @@ -333,8 +333,7 @@ func (w *pathProbe) readRow(t *table, tail []string, r tableRoute) error { case r.sel != "": if w.a != nil { walked := len(w.a.tail) - len(tail) + 1 - written := w.a.spelling[:len(w.a.spelling)-len(joinSegments(w.a.tail))] - w.sels = append(w.sels, tableSel{t, written + joinSegments(w.a.tail[:walked])}) + w.sels = append(w.sels, tableSel{t, joinSegments(append([]string{w.a.writtenHead}, w.a.tail[:walked]...))}) } return w.pins.selectRow(t, r.sel) case r.draw && w.a != nil: diff --git a/todo.md b/todo.md index aac1e3b..f27cfca 100644 --- a/todo.md +++ b/todo.md @@ -31,9 +31,6 @@ on 2026-09-29 a third time (Navigation 7.0, Locality 5.6, Shape 6.3, Self-suffic This round, in order: -- Give `arm` its head as written, set where `splitArm` splits, and build - `pathProbe.readRow`'s selector spelling from it: six seats found the slice of - `arm.spelling` by `len(joinSegments(tail))` resting on an invariant nothing states. - Pick `disagreement`'s fix through a named `itemKind` comparison: six seats could not see that the kinds' declaration order is the rule. - Give `tableSite` one test for a cell, and have `traceRead` report no row outside a