Give tableSite an isFormat beside isCell

This commit is contained in:
2026-09-30 21:37:10 +02:00
committed by Lillem4n
parent e9b8216116
commit 492772b995
3 changed files with 6 additions and 2 deletions
+4
View File
@@ -73,6 +73,10 @@ func (s tableSite) isCell() bool {
return s.table != nil && s.row != formatRow return s.table != nil && s.row != formatRow
} }
func (s tableSite) isFormat() bool {
return s.table != nil && s.row == formatRow
}
// label names the template at path in an error, a cell by its line in the rows file. // label names the template at path in an error, a cell by its line in the rows file.
func (s tableSite) label(path string) string { func (s tableSite) label(path string) string {
if s.isCell() { if s.isCell() {
+1 -1
View File
@@ -263,7 +263,7 @@ func recordOf(n node) (*template, []Column, error) {
// over sc's draws; a table's columns read the row pinned there. // over sc's draws; a table's columns read the row pinned there.
func renderRecord(s *generatorState, t *template, columns []Column, sc renderScope) *Record { func renderRecord(s *generatorState, t *template, columns []Column, sc renderScope) *Record {
sc = sc.in(t) sc = sc.in(t)
if t.site.row == formatRow { if t.site.isFormat() {
sc = sc.at(t.site.table.rowNode, &sc.groupDraws().pins) sc = sc.at(t.site.table.rowNode, &sc.groupDraws().pins)
} }
r := &Record{columns: append([]Column(nil), columns...)} r := &Record{columns: append([]Column(nil), columns...)}
+1 -1
View File
@@ -201,7 +201,7 @@ func traceRead(trace renderTrace, t *template, sc renderScope, a arm) {
switch { switch {
case t.site.isCell(): case t.site.isCell():
row = renderedRow{t.site.table, t.site.row} row = renderedRow{t.site.table, t.site.row}
case t.site.row == formatRow: case t.site.isFormat():
row = renderedRow{t.site.table, sc.rowOf(t.site.table)} row = renderedRow{t.site.table, sc.rowOf(t.site.table)}
} }
trace(strings.Clone(sc.group), row, a) trace(strings.Clone(sc.group), row, a)