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:
@@ -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:] {
|
||||
|
||||
Reference in New Issue
Block a user