From 36329f13283e6ddd2b4881d22aec1c0bc05398c0 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 5 Oct 2026 21:50:00 +0200 Subject: [PATCH] Answer architecture round 2: a keyed walk position, a plainer Above test, and docs naming the owner and the key-name refusal --- docs/decisions.md | 2 +- internal/rows/rows.go | 4 ++-- internal/rows/rows_test.go | 2 +- path.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index 96a373a..7bc2f1f 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -839,7 +839,7 @@ each value one writer would spread that knot across packages, behind forwarding every public method. The draw state, the grammar, `DataType`, what a proof knows of a value, the builtins, the reading of data files and a table's rows read no engine type, so each sits in a package under `internal/`, behind the import list `imports_test.go` checks. -A table's rows reach the engine table owning them as a payload of a type parameter. Valid +A table's rows reach the engine table owning them as their owner, a value of a type parameter. Valid until `todo.md` item 107 moves the engine. ## Goal 5.1's `{…}` covers `{{`, `}}` and a lone `}`, so the goal names no escape diff --git a/internal/rows/rows.go b/internal/rows/rows.go index 053b427..f361200 100644 --- a/internal/rows/rows.go +++ b/internal/rows/rows.go @@ -141,8 +141,8 @@ func (t *Table[O]) appendRow(row string, line int) error { return nil } -// bindOptions resolves each option to its column and proves what it claims of the -// cells: a key is unique, a weight a positive number. +// bindOptions resolves each option to its column, refuses a name reading the key column, and +// proves what the options claim of the cells: a key is unique, a weight a positive number. func (t *Table[O]) bindOptions() error { o := t.options if o.Key != "" && o.Key == o.Name { diff --git a/internal/rows/rows_test.go b/internal/rows/rows_test.go index 2728616..16f893a 100644 --- a/internal/rows/rows_test.go +++ b/internal/rows/rows_test.go @@ -110,7 +110,7 @@ func TestDrawInDrawsInsideThePinnedParentAndPinsItsAncestors(t *testing.T) { if pr := q.MustRow(country); country.Cell(pr, 0) != city.Cell(r, 0) { t.Fatalf("DrawIn pinned country %s above a city of %s", country.Cell(pr, 0), city.Cell(r, 0)) } - if above := q.Above(country); func() bool { _, ok := above.Pinned(city); return ok }() { + if _, ok := q.Above(country).Pinned(city); ok { t.Fatal("Above(country) kept the city's pin") } } diff --git a/path.go b/path.go index 37509de..6c90adf 100644 --- a/path.go +++ b/path.go @@ -164,7 +164,7 @@ func takeStep(at *pathPos, whole []string, level string, steps []pathStep, pins if err != nil { return steps, err } - *at = pathPos{r.next, r.rest, r.descends} + *at = pathPos{n: r.next, tail: r.rest, descended: r.descends} return routeSteps(steps, pins, x, r, i) case *template: if x.repeat > 1 && !grammar.IsSelector(at.tail[0]) {