From ec1dcbf9d34aae66b9b61d2b9d4984d6a09cb361 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 5 Oct 2026 00:18:46 +0200 Subject: [PATCH] Answer prose round 1: name the parent after .., mark the step down as the one exception to the shared draw, and plainer errors --- AGENTS.md | 2 +- README.md | 13 +++++++------ cmd/fejkdata/main.go | 2 +- docs/decisions.md | 13 ++++++++----- draws.go | 6 +++--- path.go | 4 ++-- reads.go | 2 +- table_test.go | 6 +++--- 8 files changed, 26 insertions(+), 22 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 9df76c5..410f2ee 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -80,7 +80,7 @@ In [docs/decisions.md](docs/decisions.md): - `parent` names the link column and the table alike - After a row, a path names a column or a linked table - A selected row is fixed, not drawn, and an unnamed read beside it is refused -- `..` steps up to the parent row, and a step down after it draws once per draw group or pick +- `..` steps up to the parent row, and a step down after it draws once per render and draw group, or per pick - A table selects by one key column, a code, never a free-form name - A parent row with no child row is a load error - The choice-of-rows fence guards a data file's root, and requires string fields diff --git a/README.md b/README.md index c2b9ce0..2e5cde7 100644 --- a/README.md +++ b/README.md @@ -552,7 +552,8 @@ A path descends from a row to a linked table by name, at any depth, and `--list` advertises each direct step. Within one render and [draw group](#draw-group), linked tables agree: the first table a reference path reads pins its ancestors, and a descendant read after it is drawn inside them, so `{/city.name}` and -`{/country.name}` are a city and its country whichever is read first. A selected row +`{/country.name}` are a city and its country whichever is read first, except a step down +after a `..` ([Step up](#step-up)). A selected row pins the render the same way, so every reference path into one family of linked tables in one render and group selects the same rows: one that selects none beside one that does is refused naming the spelling that does, `{/country[SE].city.name}` @@ -574,8 +575,8 @@ or the reference draws it. ### Step up -`..` after a row steps up to the row its link column names, and the parent table's name -follows it, as a folder's does in a filesystem path: +`..` after a row steps up to the row its link column names. Name the parent table right +after the `..`: ```sh fejkdata -d ./mydata 'city[Oslo]..country.name' # Norway @@ -585,11 +586,11 @@ fejkdata -d ./mydata '{/city as c}{c}, {c..country.name}' # Oslo, Norway ``` It steps up from a selected row, a drawn row or a [name](#names) bound to a row, one level -per `..`: `{l..municipality..region.name}`. `.country` after a row still reads the link +per `..`: `geo.SE.locality..municipality..region.name`. `.country` after a row still reads the link column's cell, `NO`. -After a `..`, `.` steps down again, drawing afresh inside the row stepped up to, -independent of the row the path stepped up from, which it may draw again. Paths stepping down from one `..` read one draw, as one +After a `..`, `.` steps down again and draws afresh inside the row stepped up to, so +`city[Göteborg]..country.city` may draw Göteborg again. Paths stepping down from one `..` read one draw, as one reference path does: `{/city..country.city.name}` and `{/city..country.city.population}` describe one city, within a render and [draw group](#draw-group), or within a name's pick. diff --git a/cmd/fejkdata/main.go b/cmd/fejkdata/main.go index c14aa09..348d50a 100644 --- a/cmd/fejkdata/main.go +++ b/cmd/fejkdata/main.go @@ -25,7 +25,7 @@ const usage = `Usage: fejkdata [flags] a category, or a dotted path into one (person, person.last); a table's row by key or name: 'misc.territory[SE]', 'misc.territory[Sweden].tld'; - .. steps up to the row a row links to: 'geo.SE.locality..municipality.name' + .. steps up from a row to the row it links to: 'geo.SE.locality..municipality.name'