Make great documentation goal 1.2, and plan the README's reorganisation and the nested-template gaps #33

Open
lilleman wants to merge 966 commits from worktree-todo-relative-dates-exact-counts into main
4 changed files with 7 additions and 7 deletions
Showing only changes of commit 38837b86a8 - Show all commits
+2 -1
View File
@@ -161,8 +161,9 @@ func paths(n node) []string {
out = append(out, p)
}
return out
default:
panic(internalError("paths has no case for node %T", n))
}
return nil
}
// tablePaths is a table's columns, then each table linked to it under its name: the
+3 -1
View File
@@ -73,8 +73,10 @@ func contained(n node) []namedNode {
}
}
return out
default:
case *nullItem, *tableRow:
return nil
default:
panic(internalError("contained has no case for node %T", n))
}
}
+2 -1
View File
@@ -49,7 +49,8 @@ func descend(s *session, root node, segments []string, sc renderScope) (node, er
// render evaluates a compiled node to a string. compile validates every node up
// front, so rendering a compiled tree cannot fail. sc holds the reference draws the
// render shares; each repeat iteration renders over a hold set of its own.
// renderEdges mirrors this switch for the fences, so a new node kind goes in both.
// renderEdges mirrors this switch for the fences. A new node kind goes in every switch
// that panics through internalError on a kind it does not list.
func render(s *session, n node, sc renderScope) string {
switch n := n.(type) {
case *choice:
-4
View File
@@ -26,10 +26,6 @@ least modify.
This round, in order:
- Make every switch over node kinds panic through `internalError` on a kind it does not
list, as `render` and `renderEdges` do, naming the kinds it skips: `contained` and
`paths` return nil. Correct `render`'s "a new node kind goes in both", which misses
the rest.
- Rename the load-time `draw*` types (`drawWalk`, `drawAt`, `drawRoute`, `drawCheck`)
to say they read and draw nothing, and move `drawWalk` and `tableRead` out of
`drawfence.go`: a grep for "draw" lands in render and check code alike.