Added key operator

This commit is contained in:
Mike Farah
2021-11-24 09:57:35 +11:00
parent 7f629d5e36
commit b44fecdfa5
27 changed files with 149 additions and 48 deletions
+2 -2
View File
@@ -61,7 +61,7 @@ func encodeOperator(d *dataTreeNavigator, context Context, expressionNode *Expre
}
stringContentNode := &yaml.Node{Kind: yaml.ScalarNode, Tag: "!!str", Value: stringValue}
results.PushBack(candidate.CreateChild(nil, stringContentNode))
results.PushBack(candidate.CreateReplacement(stringContentNode))
}
return context.ChildContext(results), nil
}
@@ -85,7 +85,7 @@ func decodeOperator(d *dataTreeNavigator, context Context, expressionNode *Expre
//first node is a doc
node := unwrapDoc(&dataBucket)
results.PushBack(candidate.CreateChild(nil, node))
results.PushBack(candidate.CreateReplacement(node))
}
return context.ChildContext(results), nil
}