diff --git a/doc_test.go b/doc_test.go index fe5b297..c805159 100644 --- a/doc_test.go +++ b/doc_test.go @@ -95,7 +95,7 @@ func vocabulary(t *testing.T, files []*ast.File) string { } // declaredSymbols is every name the package declares at the top level, a method and -// a struct field keyed under its type: hold.pin, tableRead.whole. +// a struct field keyed under its type: pinSet.pin, tableRead.whole. func declaredSymbols(files []*ast.File) map[string]bool { names := declaredFuncs(files) for _, f := range files { diff --git a/drawfence.go b/drawfence.go index 824403e..ecbffa4 100644 --- a/drawfence.go +++ b/drawfence.go @@ -229,7 +229,7 @@ func (w *drawWalk) walk(n node, at drawAt) { } for _, e := range renderEdges(n) { if cell, isCell := e.to.(*template); isCell && cell.cellOf != nil { - if at.alt.excludes(cell) { + if at.alt.clash(cell.cellOf, cell.cellRow) != nil { continue } in := at diff --git a/pins.go b/pins.go index e1abce4..9c5e469 100644 --- a/pins.go +++ b/pins.go @@ -16,14 +16,14 @@ type tablePin struct { // pinSet is the rows of tables fixed so far: by a render, by a path read replayed at load, and by // a fence walk over the rows a render can enter, which also holds a row rendered whole, alone. type pinSet struct { - pins [8]tablePin // inline, so a render over a country's five-deep geo tree stays off the heap - n int - spill map[*table]int + inline [8]tablePin // sized so a render over a country's five-deep geo tree stays off the heap + n int + spill map[*table]int } // pinned is the row pinned for t, if any. func (p *pinSet) pinned(t *table) (int, bool) { - for _, q := range p.pins[:p.n] { + for _, q := range p.inline[:p.n] { if q.t == t { return q.row, true } @@ -43,8 +43,8 @@ func (p *pinSet) mustRow(t *table) int { // add pins row r of t alone. func (p *pinSet) add(t *table, r int) { - if p.n < len(p.pins) { - p.pins[p.n] = tablePin{t, r} + if p.n < len(p.inline) { + p.inline[p.n] = tablePin{t, r} p.n++ return } @@ -70,7 +70,7 @@ func (p *pinSet) pin(t *table, r int) { // each calls fn for every pinned row, in pin order, the spilled ones by table name. func (p *pinSet) each(fn func(t *table, r int)) { - for _, q := range p.pins[:p.n] { + for _, q := range p.inline[:p.n] { fn(q.t, q.row) } spilled := make([]*table, 0, len(p.spill)) @@ -171,10 +171,10 @@ func (p pinSet) clone() pinSet { // entered is p with row r of t: pinned where the render pins it, alone where the render draws it // to render whole. p is left as it was, since a fence walk branches. -func (p pinSet) entered(t *table, r int, pins bool) pinSet { +func (p pinSet) entered(t *table, r int, pinsAncestors bool) pinSet { p = p.clone() switch _, in := p.pinned(t); { - case pins: + case pinsAncestors: p.pin(t, r) case !in: p.add(t, r) @@ -182,9 +182,6 @@ func (p pinSet) entered(t *table, r int, pins bool) pinSet { return p } -// excludes reports whether a cell's row cannot render with the rows pinned. -func (p *pinSet) excludes(cell *template) bool { return p.clash(cell.cellOf, cell.cellRow) != nil } - // key spells the set for a map, by the tables' identities in path order. func (p *pinSet) key() string { var pins []tablePin diff --git a/todo.md b/todo.md index 83fb7ed..a324f76 100644 --- a/todo.md +++ b/todo.md @@ -43,10 +43,14 @@ This round, in order: 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 callbacks are nil and whether its session is, and `walkChoice` returns `nil, nil` where - none is set. Have the check mode report the tables a read draws, so `tableRead.drawn` - and `entered`'s `pins` flag come from the walk rather than a second copy of - `walkTable`'s draw condition and `rowOf`'s ancestor rule. The mode may live in `pathWalk`; the session may not, since beside `pins` it - moves the hold maps to the heap. + none is set. The mode may live in `pathWalk`; the session may not, since beside `pins` + it moves the hold maps to the heap. +- 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 + `rowOf`'s ancestor rule: a change to how a render draws rows still leaves the fence + proving the old rule. Hold a row rendered whole in `drawAt` beside `drawn`, so + `pinSet` holds only what `pin` pins and `alternatives` needs no exception. Needs the + item above. - Register a transform once: `transforms` restates the `lowercase`, `uppercase` and `ascii` entries in `builtins`, and `valueProof.template` classifies by the first while render calls the second. Derive the numeric builtins `valueProof.template` lists in