Answer architecture round 1: one categoryPath, the walk's label named label, checkAncestors split from proveParent, and file items 115 and 116

This commit is contained in:
2026-10-05 21:10:49 +02:00
committed by Lillem4n
parent 8ffaa31e39
commit 54cb52b483
13 changed files with 106 additions and 84 deletions
+2 -2
View File
@@ -23,13 +23,13 @@ func checkCalcFields(args []string, fields map[string]node) error {
}
// checkCalcNames holds each calc of t reading a name to the checks checkCalcFields makes of a field.
func checkCalcNames(path string, t *template) error {
func checkCalcNames(label string, t *template) error {
for _, o := range t.compiled.ops {
if o.Fn != builtinfunc.CalcName || !slices.ContainsFunc(o.operands, func(a arm) bool { return a.kind == namedRead }) {
continue
}
if err := checkOperands(o.Args[0], builtinfunc.ParsedCalc(o.Args[0]), operandNodes(o)); err != nil {
return fmt.Errorf("%s: token {%s}: %w", path, o.Body, err)
return fmt.Errorf("%s: token {%s}: %w", label, o.Body, err)
}
}
return nil