Answer architecture round 1: calls carry no operands in the grammar, ParseCalc returns its operands, one empty-segment check, sorted token kinds, and file items 110 and 111

This commit is contained in:
2026-10-05 12:25:22 +02:00
committed by Lillem4n
parent 3479f9cf98
commit 6fd7da19e5
14 changed files with 103 additions and 103 deletions
+6 -4
View File
@@ -90,11 +90,13 @@ func (t *table) route(tail []string, descended bool) (tableRoute, error) {
// stepUp proves a ".." after a row of t can step up: t has a parent, rest names it, and no
// selector follows, since a row selected below the parent row could lie outside it.
func (t *table) stepUp(rest []string) error {
switch {
case t.parentT == nil:
if t.parentT == nil {
return fmt.Errorf(`%s has no parent table for ".." to step up to`, t.segment)
case len(rest) > 0 && rest[0] == "":
return fmt.Errorf("path has an empty segment")
}
if err := grammar.CheckSegments(rest); err != nil {
return err
}
switch {
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 grammar.HasSelector(rest):