2020-12-01 06:58:07 +00:00
|
|
|
package yqlib
|
|
|
|
|
2021-02-02 07:17:59 +00:00
|
|
|
func pipeOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
|
2020-12-01 06:58:07 +00:00
|
|
|
|
2023-02-28 05:40:38 +00:00
|
|
|
if expressionNode.LHS.Operation.OperationType == assignVariableOpType {
|
|
|
|
return variableLoop(d, context, expressionNode)
|
|
|
|
}
|
2021-02-02 07:17:59 +00:00
|
|
|
|
2022-02-07 00:55:55 +00:00
|
|
|
lhs, err := d.GetMatchingNodes(context, expressionNode.LHS)
|
2021-02-02 07:17:59 +00:00
|
|
|
if err != nil {
|
|
|
|
return Context{}, err
|
|
|
|
}
|
2022-02-07 00:55:55 +00:00
|
|
|
rhs, err := d.GetMatchingNodes(lhs, expressionNode.RHS)
|
2020-12-01 06:58:07 +00:00
|
|
|
if err != nil {
|
2021-02-02 07:17:59 +00:00
|
|
|
return Context{}, err
|
2020-12-01 06:58:07 +00:00
|
|
|
}
|
2021-02-02 07:17:59 +00:00
|
|
|
return context.ChildContext(rhs.MatchingNodes), nil
|
2020-12-01 06:58:07 +00:00
|
|
|
}
|