Delete the reported-order clauses and checkRecordDraws' record-only comment
This commit is contained in:
@@ -46,7 +46,6 @@ func (f *drawFence) checkRecordDraws(path string, n node) error {
|
|||||||
if !ok || !t.isRecord {
|
if !ok || !t.isRecord {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// A record-only template's format renders nothing, so weigh the columns, not the format.
|
|
||||||
columns := sortedNames(t.fields)
|
columns := sortedNames(t.fields)
|
||||||
reads := false
|
reads := false
|
||||||
for _, name := range columns {
|
for _, name := range columns {
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// walkNodes calls fn once per contained node, passing the dot path that reaches it,
|
// walkNodes calls fn once per contained node, passing the dot path that reaches it,
|
||||||
// visiting keys in sorted order so which of several broken nodes gets reported does
|
// visiting keys in sorted order.
|
||||||
// not depend on map iteration.
|
|
||||||
func walkNodes(root map[string]node, fn func(path string, n node) error) error {
|
func walkNodes(root map[string]node, fn func(path string, n node) error) error {
|
||||||
for _, name := range sortedNames(root) {
|
for _, name := range sortedNames(root) {
|
||||||
if err := eachNode(root[name], name, fn); err != nil {
|
if err := eachNode(root[name], name, fn); err != nil {
|
||||||
|
|||||||
+2
-4
@@ -28,8 +28,7 @@ func heldCheck(path string, n node) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// heldNames lists a template's held names, operands' first, then paths', each
|
// heldNames lists a template's held names, operands' first, then paths', each
|
||||||
// in name order: a level read both ways is reported by the operand's fence, and
|
// in name order: a level read both ways is reported by the operand's fence.
|
||||||
// which overlap is reported does not vary.
|
|
||||||
func heldNames(t *template) []string {
|
func heldNames(t *template) []string {
|
||||||
names := make([]string, 0, len(t.compiled.held))
|
names := make([]string, 0, len(t.compiled.held))
|
||||||
for name := range t.compiled.held {
|
for name := range t.compiled.held {
|
||||||
@@ -172,8 +171,7 @@ func renders(n node, want, seen map[node]bool) bool {
|
|||||||
// checkNoOverlap rejects a format that both renders a sibling level and reads a path
|
// checkNoOverlap rejects a format that both renders a sibling level and reads a path
|
||||||
// into it — {p} beside {p.first}, {p.addr} beside {p.addr.city}. The path reads the
|
// into it — {p} beside {p.first}, {p.addr} beside {p.addr.city}. The path reads the
|
||||||
// level's held draw while rendering the level expands it afresh, so their values would
|
// level's held draw while rendering the level expands it afresh, so their values would
|
||||||
// disagree. Reads are compared in sorted order, so which pair is reported does not
|
// disagree.
|
||||||
// depend on where the tokens sit.
|
|
||||||
// docs/decisions.md#a-bare-reference-draws-each-time-a-reference-path-is-held
|
// docs/decisions.md#a-bare-reference-draws-each-time-a-reference-path-is-held
|
||||||
func checkNoOverlap(c formatOps) error {
|
func checkNoOverlap(c formatOps) error {
|
||||||
names := pathHeadReaders(c)
|
names := pathHeadReaders(c)
|
||||||
|
|||||||
@@ -371,8 +371,7 @@ func readOptions(m map[string]any, pos position) (templateOptions, error) {
|
|||||||
return o, nil
|
return o, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// compileFields compiles every non-option key of a template object, in name order
|
// compileFields compiles every non-option key of a template object, in name order.
|
||||||
// so which of several bad fields is reported does not vary.
|
|
||||||
func compileFields(m map[string]any, pos position) (map[string]node, error) {
|
func compileFields(m map[string]any, pos position) (map[string]node, error) {
|
||||||
fields := make(map[string]node, len(m))
|
fields := make(map[string]node, len(m))
|
||||||
keys := make([]string, 0, len(m))
|
keys := make([]string, 0, len(m))
|
||||||
|
|||||||
+2
-3
@@ -214,8 +214,7 @@ func (r *tableRead) replay(d *pinSet) error {
|
|||||||
|
|
||||||
// check refuses what one draw per reference path cannot answer for: a read selecting a row its route
|
// check refuses what one draw per reference path cannot answer for: a read selecting a row its route
|
||||||
// pinned another of, a read of a level beside a path another read takes into it, and two reads of one
|
// pinned another of, a read of a level beside a path another read takes into it, and two reads of one
|
||||||
// table family that select different rows. Reads are compared in path order, so which pair is
|
// table family that select different rows.
|
||||||
// reported does not vary.
|
|
||||||
func (s *readSurvey) check() error {
|
func (s *readSurvey) check() error {
|
||||||
if s.clash != nil {
|
if s.clash != nil {
|
||||||
return s.clash
|
return s.clash
|
||||||
@@ -242,7 +241,7 @@ func (s *readSurvey) check() error {
|
|||||||
// checkFamilies refuses reads of one table family in one draw group that cannot
|
// checkFamilies refuses reads of one table family in one draw group that cannot
|
||||||
// read one consistent draw: a table rendered whole beside a path into the family,
|
// read one consistent draw: a table rendered whole beside a path into the family,
|
||||||
// a table one read draws that another pins, and two reads pinning different rows.
|
// a table one read draws that another pins, and two reads pinning different rows.
|
||||||
// The reads come sorted by group and path, so which pair is reported does not vary.
|
// The reads come sorted by group and path.
|
||||||
func checkFamilies(reads []pathRead) error {
|
func checkFamilies(reads []pathRead) error {
|
||||||
for i, r := range reads {
|
for i, r := range reads {
|
||||||
if r.tr == nil {
|
if r.tr == nil {
|
||||||
|
|||||||
@@ -34,9 +34,6 @@ ranking `readSurvey.walk` and `edge` hardest and the unit they would least modif
|
|||||||
|
|
||||||
This round, in order:
|
This round, in order:
|
||||||
|
|
||||||
- Delete the "so which … is reported does not vary" clause at its five sites past
|
|
||||||
`checkNodeFences`, and `checkRecordDraws`' "A record-only template's format renders
|
|
||||||
nothing", which runs over templates with a format too.
|
|
||||||
- Run the nine-seat panel again and file what it names here.
|
- Run the nine-seat panel again and file what it names here.
|
||||||
|
|
||||||
### Data
|
### Data
|
||||||
|
|||||||
Reference in New Issue
Block a user