yq/pkg/yqlib/operator_expression.go

17 lines
423 B
Go
Raw Permalink Normal View History

2022-11-08 02:40:00 +00:00
package yqlib
type expressionOpPreferences struct {
expression string
}
func expressionOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
prefs := expressionNode.Operation.Preferences.(expressionOpPreferences)
expNode, err := ExpressionParser.ParseExpression(prefs.expression)
if err != nil {
return Context{}, err
}
return d.GetMatchingNodes(context, expNode)
}