mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-14 23:28:06 +00:00
c6efd5519b
Allows more sophisticated functionality
18 lines
493 B
Go
18 lines
493 B
Go
package yqlib
|
|
|
|
func unionOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
|
|
lhs, err := d.GetMatchingNodes(context, expressionNode.Lhs)
|
|
if err != nil {
|
|
return Context{}, err
|
|
}
|
|
rhs, err := d.GetMatchingNodes(context, expressionNode.Rhs)
|
|
if err != nil {
|
|
return Context{}, err
|
|
}
|
|
for el := rhs.MatchingNodes.Front(); el != nil; el = el.Next() {
|
|
node := el.Value.(*CandidateNode)
|
|
lhs.MatchingNodes.PushBack(node)
|
|
}
|
|
return lhs, nil
|
|
}
|