Bind a pick to a name with {ref as n}, and read it with {n} and {n.path}

This commit is contained in:
2026-10-03 01:51:14 +02:00
committed by Lillem4n
parent ba9477f2e5
commit 23e426016d
16 changed files with 609 additions and 63 deletions
+16
View File
@@ -87,6 +87,22 @@ func indexOutside(s string, c byte) int {
return -1
}
// cutOutside cuts s around the first sep outside a [selector].
func cutOutside(s, sep string) (before, after string, found bool) {
depth := 0
for i := 0; i < len(s); i++ {
switch {
case s[i] == '[':
depth++
case s[i] == ']' && depth > 0:
depth--
case depth == 0 && strings.HasPrefix(s[i:], sep):
return s[:i], s[i+len(sep):], true
}
}
return s, "", false
}
func splitOutside(s string, c byte) []string {
var parts []string
for {