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
+10
View File
@@ -2,6 +2,7 @@ package grammar
import (
"fmt"
"slices"
"strings"
)
@@ -160,3 +161,12 @@ func JoinSegments(segs []string) string {
}
return b.String()
}
// CheckSegments refuses an unfinished path: "a." and "a...b" each have a segment naming
// nothing.
func CheckSegments(segs []string) error {
if slices.Contains(segs, "") {
return fmt.Errorf("path has an empty segment")
}
return nil
}