One spelling per shape: reject a one-item choice, a repeated item and an inert object; reshape the data

This commit is contained in:
2026-09-02 12:38:59 +02:00
parent de8c1d13e9
commit 054f99c94f
49 changed files with 620 additions and 593 deletions
+2 -4
View File
@@ -53,10 +53,8 @@ func descend(s *session, n node, segments []string) (node, error) {
}
return descend(s, child, segments[1:])
case *choice:
if len(n.items) > 1 {
if want := strings.Join(segments, "."); !n.shared[want] {
return nil, unreachableInChoice(n, want)
}
if want := strings.Join(segments, "."); !n.shared[want] {
return nil, unreachableInChoice(n, want)
}
return descend(s, pick(s, n), segments)
default: