Answer prose round 1: name the parent after .., mark the step down as the one exception to the shared draw, and plainer errors

This commit is contained in:
2026-10-05 00:18:46 +02:00
committed by Lillem4n
parent 406232e8f9
commit ec1dcbf9d3
8 changed files with 26 additions and 22 deletions
+2 -2
View File
@@ -157,7 +157,7 @@ func stepInto(n node, seg string) (node, error) {
if c, ok := n.(*tableColumn); ok {
return nil, fmt.Errorf(`".." steps up from a table's row, and %q is a column; put the ".." right after the row`, c.t.header[c.i])
}
return nil, fmt.Errorf(`".." steps up from a table's row to the row it links to, and what it follows is not a table; a path names every other level from the data root down`)
return nil, fmt.Errorf(`".." steps up only from a table's row; name any other level by its path from the data root`)
}
switch n := n.(type) {
case *folder:
@@ -238,7 +238,7 @@ func (t *table) stepUp(rest []string) error {
case len(rest) == 0 || rest[0] != t.parentT.segment:
return fmt.Errorf(`".." steps up from %s to its parent table, so name that next: %s`, t.segment, t.climbTo(rest))
case hasSelector(rest):
return fmt.Errorf(`a path selects its rows before a "..", since a row selected after it could lie outside the row it steps up to; select from the table instead, its path from the data root: %s`, joinSegments(append([]string{t.parentT.path}, rest[1:]...)))
return fmt.Errorf(`no selector after "..": a row selected there could lie outside the row stepped up to; select from the table's path from the data root: %s`, joinSegments(append([]string{t.parentT.path}, rest[1:]...)))
}
return nil
}