Name the column each case of columnReadOf reads, strip a head's / in categoryOf, and say on resolvedRef that its head carries the /

This commit is contained in:
2026-10-07 01:07:28 +02:00
committed by Lillem4n
parent 0e3c986801
commit 94e3eabbcf
2 changed files with 15 additions and 6 deletions
+4 -1
View File
@@ -8,12 +8,15 @@ import (
)
// resolvedRef is what a reference resolves to: the head its category is held
// under, and the tail read into it.
// under, its path from the root behind a "/", and the tail read into it.
type resolvedRef struct {
head string
tail []string
}
// categoryOf is the category path a resolvedRef's head names: the head without its "/".
func categoryOf(head string) string { return strings.TrimPrefix(head, "/") }
// refSegments resolves a reference written in folder to a path from the root.
func refSegments(name string, folder []string) ([]string, error) {
sigil, rest, err := grammar.RefShape(name)