Make great documentation goal 1.2, and plan the README's reorganisation and the nested-template gaps #33
@@ -1338,7 +1338,7 @@ record.go records: Record, the JSON/CSV/SQL serializers, and their entry p
|
|||||||
struct.go structs: FakeStruct, fake tags, and a field's Go type as its column's datatype
|
struct.go structs: FakeStruct, fake tags, and a field's Go type as its column's datatype
|
||||||
inline.go inline templates: Template, NewTemplate, FakeTemplate, IsTemplate, and their compile and link
|
inline.go inline templates: Template, NewTemplate, FakeTemplate, IsTemplate, and their compile and link
|
||||||
template.go the {token} grammar: scanning, tokens, operands, validation, compiling a format
|
template.go the {token} grammar: scanning, tokens, operands, validation, compiling a format
|
||||||
hold.go the hold: one draw per expansion for paths and operands
|
hold.go the hold: one draw per held name, and reading a field through it
|
||||||
holdfence.go the load fences over the hold: the routes and spellings that read one held name two ways
|
holdfence.go the load fences over the hold: the routes and spellings that read one held name two ways
|
||||||
holdset.go one reference draw per render and group: the hold set a render reads its paths through
|
holdset.go one reference draw per render and group: the hold set a render reads its paths through
|
||||||
drawfence.go the load fences over reference draws: a drawGroup's, a render's and a record's columns, and the walk over what a render reads
|
drawfence.go the load fences over reference draws: a drawGroup's, a render's and a record's columns, and the walk over what a render reads
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// hold is what has already been drawn for held names: the variant each was drawn as,
|
// hold is what has already been drawn for held names: the variant each was drawn as, so every
|
||||||
// so every path under it reads one row, and the draw each read made, by its one
|
// path under it reads one row; the draw each read made, by its one spelling, so the same read
|
||||||
// spelling, so the same read written twice reads one draw, and the table rows its reads pinned. An
|
// written twice reads one draw; and the table rows those reads pinned. An expansion keeps one for
|
||||||
// expansion keeps one for its sibling names, and a render one per group for its reference paths.
|
// its sibling names, and a render one per group for its reference paths.
|
||||||
type hold struct {
|
type hold struct {
|
||||||
variant map[string]node
|
variant map[string]node
|
||||||
value map[string]draw
|
value map[string]draw
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ type renderScope struct {
|
|||||||
row int
|
row int
|
||||||
}
|
}
|
||||||
|
|
||||||
// eagerHoldSet makes the unnamed group's maps where the set is declared, keeping them on that frame's
|
|
||||||
// stack for a render that reads through them; a zero holdSet makes them on its first read instead.
|
|
||||||
func eagerHoldSet() holdSet {
|
func eagerHoldSet() holdSet {
|
||||||
return holdSet{unnamed: hold{variant: map[string]node{}, value: map[string]draw{}}}
|
return holdSet{unnamed: hold{variant: map[string]node{}, value: map[string]draw{}}}
|
||||||
}
|
}
|
||||||
@@ -48,7 +46,6 @@ func (sc renderScope) in(t *template) renderScope {
|
|||||||
return sc
|
return sc
|
||||||
}
|
}
|
||||||
|
|
||||||
// hold is the set's hold for sc's draw group.
|
|
||||||
func (sc renderScope) hold() *hold {
|
func (sc renderScope) hold() *hold {
|
||||||
if sc.group == "" {
|
if sc.group == "" {
|
||||||
return &sc.set.unnamed
|
return &sc.set.unnamed
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ func names(segs []string) []string {
|
|||||||
|
|
||||||
// pathWalk is what one walk of a dotted path does at each kind of level: choice
|
// pathWalk is what one walk of a dotted path does at each kind of level: choice
|
||||||
// returns the variants to continue into (none stops the walk), and where it is nil
|
// returns the variants to continue into (none stops the walk), and where it is nil
|
||||||
// the walk draws one, or stops; level runs at each template a segment descends
|
// the walk draws one with s, takes the first where s is nil, or stops where pins is
|
||||||
|
// nil too; level runs at each template a segment descends
|
||||||
// into; leaf runs where the tail ends; pins is where the walk pins the table rows
|
// into; leaf runs where the tail ends; pins is where the walk pins the table rows
|
||||||
// it selects and draws, nil skipping tables. A nil action is skipped. A render's
|
// it selects and draws, nil skipping tables. A nil action is skipped. A render's
|
||||||
// walk sets only pins, so it allocates nothing.
|
// walk sets only pins, so it allocates nothing.
|
||||||
@@ -141,7 +142,8 @@ type pathWalk struct {
|
|||||||
// walkPath descends tail from n and returns the node it ends at: a folder or
|
// walkPath descends tail from n and returns the node it ends at: a folder or
|
||||||
// template by its next segment, a choice by w.choice, which consumes no segment, a
|
// template by its next segment, a choice by w.choice, which consumes no segment, a
|
||||||
// table by walkTable. A missing segment is an error, so no walk reaches past what
|
// table by walkTable. A missing segment is an error, so no walk reaches past what
|
||||||
// the data holds. s draws rows and variants; nil, the walk only proves the path.
|
// the data holds. s draws rows and variants; where it is nil, only selectors pin.
|
||||||
|
// s is a parameter: a pathWalk field beside pins moves the hold maps to the heap.
|
||||||
func walkPath(s *session, n node, tail []string, w pathWalk) (node, error) {
|
func walkPath(s *session, n node, tail []string, w pathWalk) (node, error) {
|
||||||
if len(tail) == 0 {
|
if len(tail) == 0 {
|
||||||
return n, w.atLeaf(n)
|
return n, w.atLeaf(n)
|
||||||
|
|||||||
@@ -7,21 +7,19 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// tablePin is one table's pinned row.
|
|
||||||
type tablePin struct {
|
type tablePin struct {
|
||||||
t *table
|
t *table
|
||||||
row int
|
row int
|
||||||
}
|
}
|
||||||
|
|
||||||
// pinSet is the rows of tables fixed so far: by a render, by a path read replayed at load, and by
|
// pinSet is the table rows fixed so far. A fence walk's set also holds a row rendered whole alone,
|
||||||
// a fence walk over the rows a render can enter, which also holds a row rendered whole, alone.
|
// which pin never does.
|
||||||
type pinSet struct {
|
type pinSet struct {
|
||||||
inline [8]tablePin // sized so a render over a country's five-deep geo tree stays off the heap
|
inline [8]tablePin // sized so a render over a country's five-deep geo tree stays off the heap
|
||||||
n int
|
n int
|
||||||
spill map[*table]int
|
spill map[*table]int
|
||||||
}
|
}
|
||||||
|
|
||||||
// pinned is the row pinned for t, if any.
|
|
||||||
func (p *pinSet) pinned(t *table) (int, bool) {
|
func (p *pinSet) pinned(t *table) (int, bool) {
|
||||||
for _, q := range p.inline[:p.n] {
|
for _, q := range p.inline[:p.n] {
|
||||||
if q.t == t {
|
if q.t == t {
|
||||||
@@ -136,7 +134,6 @@ func (p *pinSet) pinRow(t *table, r int) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// selectRow pins the row a selector names.
|
|
||||||
func (p *pinSet) selectRow(t *table, sel string) error {
|
func (p *pinSet) selectRow(t *table, sel string) error {
|
||||||
r, err := t.find(sel, p)
|
r, err := t.find(sel, p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -15,10 +15,7 @@ scoring run names too little to steer one. A fresh run replaces the items below.
|
|||||||
|
|
||||||
Scores, newest last: 5.9 on 2026-09-20 (Navigation 7.0, Locality 5.2, Shape 5.9,
|
Scores, newest last: 5.9 on 2026-09-20 (Navigation 7.0, Locality 5.2, Shape 5.9,
|
||||||
Self-sufficiency 5.7); 5.8 on 2026-09-22 (Navigation 6.7, Locality 5.0, Shape 5.9,
|
Self-sufficiency 5.7); 5.8 on 2026-09-22 (Navigation 6.7, Locality 5.0, Shape 5.9,
|
||||||
Self-sufficiency 5.6), every seat capped by Locality or Self-sufficiency. Eight of nine
|
Self-sufficiency 5.6), every seat capped by Locality or Self-sufficiency.
|
||||||
named `drawWalk.walk` and `rowSet` or `checkFamilies` hardest and least wanted to modify:
|
|
||||||
a load-time copy of the pinning `hold.pin` and `hold.rowOf` do at render, tied to them
|
|
||||||
by nothing but tests, whose premise lives only in the README's Decisions.
|
|
||||||
|
|
||||||
This round, in order:
|
This round, in order:
|
||||||
|
|
||||||
@@ -42,9 +39,8 @@ This round, in order:
|
|||||||
`operandReader`, `checkNoRepeatedRead` and `compileOps`, and function-versus-field is
|
`operandReader`, `checkNoRepeatedRead` and `compileOps`, and function-versus-field is
|
||||||
decided by `indexOutside(body, '(')` in two of them and by `funcCall` in the rest.
|
decided by `indexOutside(body, '(')` in two of them and by `funcCall` in the rest.
|
||||||
- Name `pathWalk`'s modes: render, probe, check and cover are chosen today by which
|
- Name `pathWalk`'s modes: render, probe, check and cover are chosen today by which
|
||||||
callbacks are nil and whether its session is, and `walkChoice` returns `nil, nil` where
|
callbacks are nil and whether `walkPath`'s session is, and `walkChoice` returns
|
||||||
none is set. The mode may live in `pathWalk`; the session may not, since beside `pins`
|
`nil, nil` where none is set.
|
||||||
it moves the hold maps to the heap.
|
|
||||||
- Have the check mode report the tables a read draws, so `tableRead.drawn` and
|
- Have the check mode report the tables a read draws, so `tableRead.drawn` and
|
||||||
`entered`'s `pinsAncestors` flag stop restating `walkTable`'s draw condition and
|
`entered`'s `pinsAncestors` flag stop restating `walkTable`'s draw condition and
|
||||||
`rowOf`'s ancestor rule: a change to how a render draws rows still leaves the fence
|
`rowOf`'s ancestor rule: a change to how a render draws rows still leaves the fence
|
||||||
@@ -59,7 +55,7 @@ This round, in order:
|
|||||||
- Split `drawCheck.reads`'s six-term condition into named predicates.
|
- Split `drawCheck.reads`'s six-term condition into named predicates.
|
||||||
- Rename what names two things: `template.go` holds the token grammar while `template`
|
- Rename what names two things: `template.go` holds the token grammar while `template`
|
||||||
is `node.go`'s type and `Template` `inline.go`'s; `kind` `'b'` is a brace body in
|
is `node.go`'s type and `Template` `inline.go`'s; `kind` `'b'` is a brace body in
|
||||||
`ftoken` and a builtin in `op`; `hold`'s receiver is `d`; `drawAt.alt` holds the rows
|
`ftoken` and a builtin in `op`; `drawAt.alt` holds the rows
|
||||||
a walk entered.
|
a walk entered.
|
||||||
- Run the nine-seat panel again and file what it names here.
|
- Run the nine-seat panel again and file what it names here.
|
||||||
|
|
||||||
@@ -307,6 +303,8 @@ because pairing a street with its exact postnummer rewrites shipped rows.
|
|||||||
- Delete `doc.go`'s "The draw fences are …" sentence: it names a function, a type and
|
- Delete `doc.go`'s "The draw fences are …" sentence: it names a function, a type and
|
||||||
a helper reached only through `drawWalk.check`, and misses `checkDrawGroup`,
|
a helper reached only through `drawWalk.check`, and misses `checkDrawGroup`,
|
||||||
`checkOwnFamily` and `checkColumnDraws`; the README's Layout indexes the fences by file.
|
`checkOwnFamily` and `checkColumnDraws`; the README's Layout indexes the fences by file.
|
||||||
|
- Cut the README's Layout block to the lines that say what a file name cannot:
|
||||||
|
`calc.go`, `doc.go` and `cmd/fejkdata/` restate their names.
|
||||||
- Cut `AGENTS.md` to the rules only it states: the round procedure stands word for word
|
- Cut `AGENTS.md` to the rules only it states: the round procedure stands word for word
|
||||||
in `todo.md` and the `gh` rule opens with the README's GitHub decision, so each is a
|
in `todo.md` and the `gh` rule opens with the README's GitHub decision, so each is a
|
||||||
second copy that drifts. Split the comprehension rule while there, which packs the
|
second copy that drifts. Split the comprehension rule while there, which packs the
|
||||||
|
|||||||
Reference in New Issue
Block a user