MCPcopy Index your code
hub / github.com/TomWright/dasel / chainedExprExecutor

Function chainedExprExecutor

execution/execute.go:168–181  ·  view source on GitHub ↗
(e ast.ChainedExpr)

Source from the content-addressed store, hash-verified

166}
167
168func chainedExprExecutor(e ast.ChainedExpr) (expressionExecutor, error) {
169 return func(ctx context.Context, options *Options, data *model.Value) (*model.Value, error) {
170 ctx = WithExecutorID(ctx, "chainedExpr")
171 var curData = data
172 for _, expr := range e.Exprs {
173 res, err := ExecuteAST(ctx, expr, curData, options)
174 if err != nil {
175 return nil, fmt.Errorf("error executing expression: %w", err)
176 }
177 curData = res
178 }
179 return curData, nil
180 }, nil
181}
182
183func variableExprExecutor(e ast.VariableExpr) (expressionExecutor, error) {
184 return func(ctx context.Context, options *Options, data *model.Value) (*model.Value, error) {

Callers 1

exprExecutorFunction · 0.85

Calls 2

WithExecutorIDFunction · 0.85
ExecuteASTFunction · 0.85

Tested by

no test coverage detected