Unify canonical sequence index semantics for version decoding
This commit is contained in:
@@ -2,7 +2,6 @@ package configkit
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"strconv"
|
||||
|
||||
"gitea.maximumdirect.net/eric/ConfigKit/internal/document"
|
||||
)
|
||||
@@ -238,26 +237,7 @@ func isIntegerVersion(node *document.Node) bool {
|
||||
}
|
||||
|
||||
func pathMatches(configured *Path, current Path) bool {
|
||||
if configured == nil || !configured.valid() || !current.valid() || len(configured.segments) != len(current.segments) {
|
||||
return false
|
||||
}
|
||||
for i, expected := range configured.segments {
|
||||
actual := current.segments[i]
|
||||
if expected.kind == pathSegmentParsed {
|
||||
if actual.kind == pathSegmentIndex {
|
||||
if expected.key != strconv.Itoa(actual.index) {
|
||||
return false
|
||||
}
|
||||
} else if expected.key != actual.key {
|
||||
return false
|
||||
}
|
||||
continue
|
||||
}
|
||||
if expected.kind != actual.kind || expected.key != actual.key || expected.index != actual.index {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
return configured != nil && current.valid() && matchesPathShape(*configured, current)
|
||||
}
|
||||
|
||||
func documentLocationPointer(location document.Location) *Location {
|
||||
|
||||
Reference in New Issue
Block a user