Rename checkResolves to checkPathResolves
This commit is contained in:
@@ -262,7 +262,7 @@ func checkArm(name string, fields map[string]node, wholeToken bool) error {
|
|||||||
}
|
}
|
||||||
return fmt.Errorf("no field %q", a.head)
|
return fmt.Errorf("no field %q", a.head)
|
||||||
}
|
}
|
||||||
if err := checkResolves(field, a.tail, a.head); err != nil {
|
if err := checkPathResolves(field, a.tail, a.head); err != nil {
|
||||||
return fmt.Errorf("field %q: %w", a.head, err)
|
return fmt.Errorf("field %q: %w", a.head, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -472,12 +472,12 @@ func unreachableInChoice(c *choice, want string) error {
|
|||||||
return fmt.Errorf("not every variant of this %d-way choice carries %q; all carry %v", len(c.items), want, offered)
|
return fmt.Errorf("not every variant of this %d-way choice carries %q; all carry %v", len(c.items), want, offered)
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkResolves(n node, tail []string, level string) error {
|
func checkPathResolves(n node, tail []string, level string) error {
|
||||||
_, err := (&pathCheck{level: level, tail: tail}).run(n)
|
_, err := (&pathCheck{level: level, tail: tail}).run(n)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// compilePath compiles a path checkResolves proved.
|
// compilePath compiles a path checkPathResolves proved.
|
||||||
func compilePath(n node, tail []string) pathCheck {
|
func compilePath(n node, tail []string) pathCheck {
|
||||||
w := pathCheck{tail: tail}
|
w := pathCheck{tail: tail}
|
||||||
if _, err := w.run(n); err != nil {
|
if _, err := w.run(n); err != nil {
|
||||||
|
|||||||
+1
-1
@@ -147,7 +147,7 @@ func (t *template) resolveLink(folder []string, path, category string, root map[
|
|||||||
if category != "" && head == "/"+category {
|
if category != "" && head == "/"+category {
|
||||||
return link, fmt.Errorf("%s: reference {%s}: names the category it sits in; read a sibling field as a path, or move the shared value into its own category and reference that", path, name)
|
return link, fmt.Errorf("%s: reference {%s}: names the category it sits in; read a sibling field as a path, or move the shared value into its own category and reference that", path, name)
|
||||||
}
|
}
|
||||||
if err := checkResolves(target, tail, head); err != nil {
|
if err := checkPathResolves(target, tail, head); err != nil {
|
||||||
return link, fmt.Errorf("%s: reference {%s}: %w", path, name, err)
|
return link, fmt.Errorf("%s: reference {%s}: %w", path, name, err)
|
||||||
}
|
}
|
||||||
link.refHeads[head] = target
|
link.refHeads[head] = target
|
||||||
|
|||||||
Reference in New Issue
Block a user