Move List's path enumeration into list.go, position into node.go and sortedNames into sorted.go

This commit is contained in:
2026-10-07 02:08:38 +02:00
committed by Lillem4n
parent 6c8ddeb3ac
commit 63e985a53d
6 changed files with 126 additions and 118 deletions
+10
View File
@@ -163,6 +163,16 @@ func rowShape(raw any) (format string, fields []string, weighted, isRow bool) {
return format, fields, weighted, true
}
// position is where a JSON value sits, which decides whether it may carry a datatype or
// be null.
type position int
const (
inFormat position = iota // rendered by a format, so neither
atTop // a category or an inline template, whose fields may be columns
inColumn // a column, or a choice item standing in for one
)
// compileAt compiles a node that is no choice's item. Only a choice's items carry a
// weight, so one here would be inert whatever its type.
func compileAt(v any, pos position) (node, error) {