diff --git a/graph.go b/graph.go index 08358f2..79ad8bd 100644 --- a/graph.go +++ b/graph.go @@ -63,6 +63,9 @@ func contained(n node) []namedNode { case *table: return append([]namedNode{{node: n.format}}, named(n.fields)...) case *column: + if len(n.t.tokens) == 0 { + return nil + } var out []namedNode for r := 0; r < n.t.rows(); r++ { if cell := n.t.cellNode(r, n.i); cell != nil { diff --git a/table.go b/table.go index 3f94851..dd8c811 100644 --- a/table.go +++ b/table.go @@ -285,7 +285,7 @@ func (t *table) checkCells() error { if (col == t.key || col == t.name) && strings.ContainsAny(cell, inSelector) { return fmt.Errorf("line %d: %s %q contains %q, which a selector cannot spell", row+2, t.columns[col], cell, cell[strings.IndexAny(cell, inSelector):][:1]) } - if !strings.ContainsAny(cell, "{}") { + if strings.IndexByte(cell, '{') < 0 && strings.IndexByte(cell, '}') < 0 { continue } n, err := compileString(cell)