Widen the naming fence to the tests, and record what each stem names

This commit is contained in:
2026-09-21 21:50:16 +02:00
committed by Lillem4n
parent d128621fc1
commit a52adc6b0d
7 changed files with 55 additions and 30 deletions
+5 -5
View File
@@ -42,14 +42,14 @@ func shippedShape(f *Generator) string {
walk(join(prefix, name), n.children[name])
}
case *choice:
facts[prefix] = reads(n)
facts[prefix] = readsFact(n)
case *table:
facts[prefix] = "\tformat " + strconv.Quote(n.format.format) + tableFacts(n) + reads(n)
facts[prefix] = "\tformat " + strconv.Quote(n.format.format) + tableFacts(n) + readsFact(n)
for _, name := range n.columns {
facts[join(prefix, name)] = "\tstring"
}
case *template:
facts[prefix] = "\tformat " + strconv.Quote(n.format) + reads(n)
facts[prefix] = "\tformat " + strconv.Quote(n.format) + readsFact(n)
if _, columns, err := recordOf(n); err == nil {
for _, c := range columns {
fact := "\t" + c.DataType.String()
@@ -85,8 +85,8 @@ func tableFacts(t *table) string {
return b.String()
}
// reads names the categories any template under n references, sorted.
func reads(n node) string {
// readsFact names the categories any template under n references, sorted.
func readsFact(n node) string {
set := map[string]bool{}
var collect func(node)
collect = func(n node) {