mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-14 07:08:06 +00:00
20 lines
502 B
Go
20 lines
502 B
Go
package yqlib
|
|
|
|
import "container/list"
|
|
|
|
func unionOperator(d *dataTreeNavigator, matchingNodes *list.List, expressionNode *ExpressionNode) (*list.List, error) {
|
|
lhs, err := d.GetMatchingNodes(matchingNodes, expressionNode.Lhs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
rhs, err := d.GetMatchingNodes(matchingNodes, expressionNode.Rhs)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
for el := rhs.Front(); el != nil; el = el.Next() {
|
|
node := el.Value.(*CandidateNode)
|
|
lhs.PushBack(node)
|
|
}
|
|
return lhs, nil
|
|
}
|