MCPcopy Create free account
hub / github.com/araddon/qlbridge / walkArray

Function walkArray

vm/vm.go:937–948  ·  view source on GitHub ↗

walkArray Array evaluator: evaluate multiple values into an array (b,c,d)

(ctx expr.EvalContext, node *expr.ArrayNode, depth int)

Source from the content-addressed store, hash-verified

935// (b,c,d)
936//
937func walkArray(ctx expr.EvalContext, node *expr.ArrayNode, depth int) (value.Value, bool) {
938
939 vals := make([]value.Value, len(node.Args))
940
941 for i := 0; i < len(node.Args); i++ {
942 v, _ := Eval(ctx, node.Args[i])
943 vals[i] = v
944 }
945
946 // we are returning an array of evaluated nodes
947 return value.NewSliceValues(vals), true
948}
949
950// walkFunc evaluates a function
951func walkFunc(ctx expr.EvalContext, node *expr.FuncNode, depth int) (value.Value, bool) {

Callers 1

evalDepthFunction · 0.85

Calls 2

NewSliceValuesFunction · 0.92
EvalFunction · 0.85

Tested by

no test coverage detected