mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 05:38:04 +00:00
19 lines
573 B
Go
19 lines
573 B
Go
package yqlib
|
|
|
|
func pipeOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
|
|
|
|
if expressionNode.LHS.Operation.OperationType == assignVariableOpType {
|
|
return variableLoop(d, context, expressionNode)
|
|
}
|
|
lhs, err := d.GetMatchingNodes(context, expressionNode.LHS)
|
|
if err != nil {
|
|
return Context{}, err
|
|
}
|
|
rhsContext := context.ChildContext(lhs.MatchingNodes)
|
|
rhs, err := d.GetMatchingNodes(rhsContext, expressionNode.RHS)
|
|
if err != nil {
|
|
return Context{}, err
|
|
}
|
|
return context.ChildContext(rhs.MatchingNodes), nil
|
|
}
|