Extracted out is path expression checking logic

This commit is contained in:
Mike Farah
2020-01-11 19:30:27 +11:00
parent 2d237e7e8e
commit 35fd5b7ae4
8 changed files with 21 additions and 9 deletions
+2 -1
View File
@@ -74,7 +74,8 @@ func guessKind(head string, tail []string, guess yaml.Kind) yaml.Kind {
if tail[0] == "+" || errorParsingInt == nil {
return yaml.SequenceNode
}
if (tail[0] == "*" || tail[0] == "**" || head == "**") && (guess == yaml.SequenceNode || guess == yaml.MappingNode) {
pathParser := NewPathParser()
if (pathParser.IsPathExpression(tail[0]) || head == "**") && (guess == yaml.SequenceNode || guess == yaml.MappingNode) {
return guess
}
if guess == yaml.AliasNode {