Add the table node: rows TSV, key and name selection, linked tables drawn consistently, and the choice-of-rows fence

This commit is contained in:
2026-09-17 12:28:46 +02:00
parent d4060e041a
commit f6b54c8ae6
20 changed files with 1517 additions and 151 deletions
+24
View File
@@ -85,6 +85,8 @@ func (p *valueProof) of(n node) proven {
v = p.unite(n.items)
case *template:
v = p.template(n)
case *column:
v = p.cells(n)
default:
v = unproven(`it reads a null, which renders "" outside its own column`)
}
@@ -92,6 +94,28 @@ func (p *valueProof) of(n node) proven {
return v
}
// cells proves a table column over every cell it may render.
func (p *valueProof) cells(c *column) proven {
if c.i < 0 {
return unproven(fmt.Sprintf("%q renders a row of %s, which is composed text", c.t.format.format, c.t.category))
}
var v proven
for r := 0; r < c.t.rows(); r++ {
var w proven
if cell := c.t.cellNode(r, c.i); cell != nil {
w = p.of(cell)
} else {
w = literalValue(c.t.cell(r, c.i))
}
if r == 0 {
v = w
} else {
v = v.or(w)
}
}
return v
}
func (p *valueProof) unite(nodes []node) proven {
v := p.of(nodes[0])
for _, n := range nodes[1:] {