Name the fold's route type readRoute, and reword the next item to what it still asks

This commit is contained in:
2026-09-29 21:49:37 +02:00
committed by Lillem4n
parent 2b61433258
commit 2306834995
3 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ type readSurvey struct {
// pinClash is the first read whose selectors clash with a row its route pinned. // pinClash is the first read whose selectors clash with a row its route pinned.
type pinClash struct { type pinClash struct {
route surveyRoute route readRoute
spelling string spelling string
err error err error
} }
@@ -255,7 +255,7 @@ func alternatives(a, b branches) bool {
return a.pins.differs(&b.pins) || a.wholePins.differs(&b.wholePins) return a.pins.differs(&b.pins) || a.wholePins.differs(&b.wholePins)
} }
func overlapError(route surveyRoute, ref string, into pathRead) error { func overlapError(route readRoute, ref string, into pathRead) error {
apart := "" apart := ""
switch { switch {
case route.spelling == into.route.spelling: case route.spelling == into.route.spelling:
+12 -12
View File
@@ -2,8 +2,8 @@ package fejkdata
import "fmt" import "fmt"
// surveyRoute is how a render reaches a read: as its author spells it, and the root edge's label. // readRoute is how a render reaches a read: as its author spells it, and the root edge's label.
type surveyRoute struct{ spelling, label string } type readRoute struct{ spelling, label string }
// branches is the rows a read sits under: those pinned above it, and those of whole draws whose // branches is the rows a read sits under: those pinned above it, and those of whole draws whose
// cells it sits in. // cells it sits in.
@@ -17,7 +17,7 @@ type branches struct {
// branches. // branches.
type pathRead struct { type pathRead struct {
group string group string
route surveyRoute route readRoute
branches branches branches branches
a arm a arm
tr *tableRead // set where the reference names a table tr *tableRead // set where the reference names a table
@@ -44,7 +44,7 @@ func newReadFold() *readFold { return &readFold{memo: map[node][]pathRead{}} }
func (f *readFold) rootReads(t *template) []pathRead { func (f *readFold) rootReads(t *template) []pathRead {
var reads []pathRead var reads []pathRead
for _, e := range renderEdges(t) { for _, e := range renderEdges(t) {
reads = append(reads, f.viaEdge(t, e, surveyRoute{e.reached(), e.label})...) reads = append(reads, f.viaEdge(t, e, readRoute{e.reached(), e.label})...)
} }
return reads return reads
} }
@@ -53,7 +53,7 @@ func (f *readFold) rootReads(t *template) []pathRead {
func (f *readFold) columnReads(t *template, columns []string) []pathRead { func (f *readFold) columnReads(t *template, columns []string) []pathRead {
var reads []pathRead var reads []pathRead
for _, name := range columns { for _, name := range columns {
reads = append(reads, routed(f.reads(t.fields[name]), surveyRoute{spelling: fmt.Sprintf("column %q", name)})...) reads = append(reads, routed(f.reads(t.fields[name]), readRoute{spelling: fmt.Sprintf("column %q", name)})...)
} }
return reads return reads
} }
@@ -76,7 +76,7 @@ func (f *readFold) reads(n node) []pathRead {
break break
} }
for _, e := range renderEdges(n) { for _, e := range renderEdges(n) {
out = append(out, f.viaEdge(n, e, surveyRoute{})...) out = append(out, f.viaEdge(n, e, readRoute{})...)
} }
if n.link.drawGroupKey != "" { if n.link.drawGroupKey != "" {
for i := range out { for i := range out {
@@ -118,7 +118,7 @@ func distinct(reads []pathRead) []pathRead {
// viaEdge is what rendering e from n reads: the reference e reads, then what its leaf renders // viaEdge is what rendering e from n reads: the reference e reads, then what its leaf renders
// under the rows that reference pins. // under the rows that reference pins.
func (f *readFold) viaEdge(n node, e renderEdge, route surveyRoute) []pathRead { func (f *readFold) viaEdge(n node, e renderEdge, route readRoute) []pathRead {
if !e.readsRef() { if !e.readsRef() {
return routed(f.reads(e.to), route) return routed(f.reads(e.to), route)
} }
@@ -162,7 +162,7 @@ func (f *readFold) rowReads(t *table, tag func(*branches, int) bool) []pathRead
out = append(out, f.cellReads(c, tag)...) out = append(out, f.cellReads(c, tag)...)
continue continue
} }
out = append(out, f.viaEdge(t.formatTemplate, e, surveyRoute{})...) out = append(out, f.viaEdge(t.formatTemplate, e, readRoute{})...)
} }
return out return out
} }
@@ -194,13 +194,13 @@ func (b *branches) enter(t *table, r int) bool {
} }
// routed names the route the render's root reaches reads by, where none is named yet. // routed names the route the render's root reaches reads by, where none is named yet.
func routed(reads []pathRead, route surveyRoute) []pathRead { func routed(reads []pathRead, route readRoute) []pathRead {
if route == (surveyRoute{}) { if route == (readRoute{}) {
return reads return reads
} }
out := make([]pathRead, len(reads)) out := make([]pathRead, len(reads))
for i, r := range reads { for i, r := range reads {
if r.route == (surveyRoute{}) { if r.route == (readRoute{}) {
r.route = route r.route = route
} }
out[i] = r out[i] = r
@@ -210,7 +210,7 @@ func routed(reads []pathRead, route surveyRoute) []pathRead {
// spelled names the route, and the reference it reaches a read by where its root edge is not that // spelled names the route, and the reference it reaches a read by where its root edge is not that
// reference. // reference.
func (r surveyRoute) spelled(ref string) string { func (r readRoute) spelled(ref string) string {
if ref == "" || ref == r.label { if ref == "" || ref == r.label {
return r.spelling return r.spelling
} }
+1 -1
View File
@@ -36,7 +36,7 @@ on 2026-09-29 a fifth time (Navigation 6.9, Locality 5.2, Shape 6.1, Self-suffic
This round, in order: This round, in order:
- Name what a read sits under `branches`, the rows pinned with their ancestors and the - Say at `branches` what its two sets hold, the rows pinned with their ancestors and the
rows of whole draws without, both load-bearing, and fold `check`, `checkFamilies`, rows of whole draws without, both load-bearing, and fold `check`, `checkFamilies`,
`replayPairs`, `checkFamilyPair` and `alternatives` into one pairwise loop over `replayPairs`, `checkFamilyPair` and `alternatives` into one pairwise loop over
`coRender` and `conflict`. Report a pin clash lowest by route and spelling, so which of `coRender` and `conflict`. Report a pin clash lowest by route and spelling, so which of