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
2 changed files with 14 additions and 2 deletions
Showing only changes of commit ab0a10115d - Show all commits
+14 -1
View File
@@ -119,7 +119,7 @@ func (c *drawCheck) reads(n node, stopAtGroup bool) bool {
}
r := false
for _, e := range renderEdges(n) {
if a, isRef := refRead(n, e.label); (isRef && (len(a.tail) > 0 || readsTable(n, a))) || (!repeats(e.to) && !(stopAtGroup && grouped(e.to)) && c.reads(e.to, stopAtGroup)) {
if readsOnEdge(n, e.label) || (walksInto(e.to, stopAtGroup) && c.reads(e.to, stopAtGroup)) {
r = true
break
}
@@ -131,6 +131,19 @@ func (c *drawCheck) reads(n node, stopAtGroup bool) bool {
return r
}
// readsOnEdge reports whether an edge of n is itself a reference path: a reference with a tail, or
// one naming a table.
func readsOnEdge(n node, label string) bool {
a, isRef := refRead(n, label)
return isRef && (len(a.tail) > 0 || readsTable(n, a))
}
// walksInto reports whether reads walks on into to, which it does short of a repeat, and of a draw
// group when stopAtGroup.
func walksInto(to node, stopAtGroup bool) bool {
return !repeats(to) && !(stopAtGroup && grouped(to))
}
func repeats(n node) bool {
t, isTemplate := n.(*template)
return isTemplate && t.repeat > 1
-1
View File
@@ -19,7 +19,6 @@ Self-sufficiency 5.6), every seat capped by Locality or Self-sufficiency.
This round, in order:
- Split `drawCheck.reads`'s six-term condition into named predicates.
- Rename what names two things: `template.go` holds the token grammar while `template`
is `node.go`'s type and `Template` `inline.go`'s; `kind` `'b'` is a brace body in
`ftoken` and a builtin in `formatToken` and `op`; `tokens` is a template's parsed format