From 10dbd471fbf5e2e921caf9644bf6520c7e0c3515 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Wed, 7 Oct 2026 01:49:54 +0200 Subject: [PATCH] Delete the doc lines the 2026-10-07 panel read as restating their code, and say what gatherFields' index is --- data.go | 1 - env.go | 1 - fejkdata.go | 1 - graph.go | 1 - internal/rows/pins.go | 1 - name.go | 2 -- node.go | 1 - render.go | 1 - resolve.go | 2 -- struct.go | 2 +- table.go | 1 - 11 files changed, 1 insertion(+), 13 deletions(-) diff --git a/data.go b/data.go index 1ab23db..6e0907c 100644 --- a/data.go +++ b/data.go @@ -96,7 +96,6 @@ func siteIn(dir []string, in *folder, name string) categorySite { return categorySite{dir: dir, path: categoryPath(dir, name), in: in, n: in.children[name]} } -// categoryPath is the dot path of the category name in the folder dir. func categoryPath(dir []string, name string) string { return join(strings.Join(dir, "."), name) } func siteNodes(sites []categorySite) nodeSet { diff --git a/env.go b/env.go index 3c5b405..9327b2f 100644 --- a/env.go +++ b/env.go @@ -43,7 +43,6 @@ func (env renderEnv) at(n node, pins *pinSet) renderEnv { return env } -// rowOf is the row of t its columns render from. func (env renderEnv) rowOf(t *table) int { if env.row.t != t { panic(invariant.Broken("a column of %s renders in an env holding no row of it", t.rows.Segment())) diff --git a/fejkdata.go b/fejkdata.go index cd04201..5114031 100644 --- a/fejkdata.go +++ b/fejkdata.go @@ -93,7 +93,6 @@ func New(opts ...Option) (*Generator, error) { return &Generator{drawState: drawstate.New(seed), root: root}, nil } -// load is the tree New starts from. // docs/decisions.md#with-only-the-shipped-set-a-category-loads-on-the-first-call-reaching-it-beside-a---data-path-every-category-loads-in-new func (c config) load() (folder, error) { if c.shipped && len(c.sources) == 0 { diff --git a/graph.go b/graph.go index c0afe30..44f4b71 100644 --- a/graph.go +++ b/graph.go @@ -41,7 +41,6 @@ type namedNode struct { line int // a table cell's line in its rows file, else 0 } -// labelIn is c's label inside the node labelled label. func (c namedNode) labelIn(label string) string { if c.line > 0 { return fmt.Sprintf("%s, line %d", label, c.line) diff --git a/internal/rows/pins.go b/internal/rows/pins.go index b311a12..38d7f3e 100644 --- a/internal/rows/pins.go +++ b/internal/rows/pins.go @@ -100,7 +100,6 @@ func (p *Pins[O]) PinRow(t *Table[O], r int) error { return nil } -// Select pins the row of t that sel names, and returns it. func (p *Pins[O]) Select(t *Table[O], sel string) (int, error) { r, err := t.find(sel, p) if err != nil { diff --git a/name.go b/name.go index e0e06f2..a901790 100644 --- a/name.go +++ b/name.go @@ -99,7 +99,6 @@ func bindNames(root node) error { return checkEveryNameRead(scopes, read) } -// checkEveryNameRead refuses a binding of scopes that nothing reads. func checkEveryNameRead(scopes []*nameScope, read map[*nameBinding]bool) error { for _, sc := range scopes { for _, b := range sc.order { @@ -111,7 +110,6 @@ func checkEveryNameRead(scopes []*nameScope, read map[*nameBinding]bool) error { return nil } -// bindAll binds every name t's tokens bind. func (sc *nameScope) bindAll(t *template, inChoice bool, where string) error { for _, tok := range t.tokens { if tok.Kind != grammar.NameBind { diff --git a/node.go b/node.go index 5749cb2..c1404ee 100644 --- a/node.go +++ b/node.go @@ -365,7 +365,6 @@ func readOptions(m map[string]any, pos position) (templateOptions, error) { return o, nil } -// compileFields compiles every non-option key of a template object. func compileFields(m map[string]any, pos position) (map[string]node, error) { fields := make(map[string]node, len(m)) for _, k := range sortedNames(m) { diff --git a/render.go b/render.go index c369b89..3c3f58c 100644 --- a/render.go +++ b/render.go @@ -46,7 +46,6 @@ func descend(s *drawstate.State, root node, segments []string) (node, pinSet, er return n, *leafPins, nil } -// renderOnce renders n as one render, over frames of its own. func renderOnce(s *drawstate.State, n node) string { var frames frameStack return render(s, n, renderEnv{frames: &frames}) diff --git a/resolve.go b/resolve.go index 24b7023..3332bbd 100644 --- a/resolve.go +++ b/resolve.go @@ -32,7 +32,6 @@ func resolveCategoryTemplates(sites []categorySite, root map[string]node) error return resolveTemplates(ts, root) } -// resolveInlineTemplates resolves the templates of an inline node against the loaded tree. func resolveInlineTemplates(nodes nodeSet, root map[string]node) error { var ts []templateSite if err := nodes(func(label string, n node) error { @@ -134,7 +133,6 @@ func addressedKeys(ts []templateSite, targets map[*nameBinding]nameTarget) map[* return keys } -// nameUses is every read of each name in ts. func nameUses(ts []templateSite) map[*nameBinding][]nameUse { uses := map[*nameBinding][]nameUse{} for _, s := range ts { diff --git a/struct.go b/struct.go index 3e669c1..a67f82a 100644 --- a/struct.go +++ b/struct.go @@ -127,7 +127,7 @@ func (sc *structCompile) spend(label string) error { return fmt.Errorf(`%s: the struct fields reach more than %d structs; leave a struct field unfilled with fake:"-"`, label, maxStructs) } -// t sits at index within c.typ. +// index is the field index path, as reflect's FieldByIndex takes, from c.typ to t. func (c *structFields) gatherFields(t reflect.Type, index []int) error { for i := 0; i < t.NumField(); i++ { sf := t.Field(i) diff --git a/table.go b/table.go index 3fa0e0d..fe6beb2 100644 --- a/table.go +++ b/table.go @@ -203,7 +203,6 @@ func refuseTableBinding(toks []grammar.Token) error { return nil } -// linkTables links each table to the parent beside it. func linkTables(sites []categorySite) error { for _, s := range sites { t, isTable := s.n.(*table)