Set a table's path when it compiles, link a table family in one function, and label a cell from the walk
This commit is contained in:
+3
-3
@@ -17,16 +17,16 @@ func checkNameReads(path string, t *template) error {
|
||||
continue
|
||||
}
|
||||
if err := t.nameScope.bindings[tok.Bound].checkUses(); err != nil {
|
||||
return fmt.Errorf("%s: token {%s}: %w", t.site.label(path), tok.Body, err)
|
||||
return fmt.Errorf("%s: token {%s}: %w", path, tok.Body, err)
|
||||
}
|
||||
}
|
||||
return namedReads(t, func(o *op, a *arm) error {
|
||||
if a.named.bindsField() && rendersInside(compilePath(a.named.head, a.named.tail).leaves, t) {
|
||||
return fmt.Errorf("%s: token {%s}: name %q is read inside %q, the field bound to it; read the name outside that field", t.site.label(path), o.Body, a.named.name, a.named.ref)
|
||||
return fmt.Errorf("%s: token {%s}: name %q is read inside %q, the field bound to it; read the name outside that field", path, o.Body, a.named.name, a.named.ref)
|
||||
}
|
||||
for _, leaf := range a.leaves {
|
||||
if err := a.named.checkOnce(a.spelling, leaf, a.path); err != nil {
|
||||
return fmt.Errorf("%s: token {%s}: %w", t.site.label(path), o.Body, err)
|
||||
return fmt.Errorf("%s: token {%s}: %w", path, o.Body, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user