MCPcopy Create free account
hub / github.com/cel-expr/cel-go / NewExecutionFrame

Function NewExecutionFrame

interpreter/frame.go:135–155  ·  view source on GitHub ↗

NewExecutionFrame creates a new execution frame from the pool.

(input any)

Source from the content-addressed store, hash-verified

133
134// NewExecutionFrame creates a new execution frame from the pool.
135func NewExecutionFrame(input any) (*ExecutionFrame, error) {
136 f := frameStack.Get().(*ExecutionFrame)
137 switch v := input.(type) {
138 case emptyActivation:
139 // empty frame, no backing scope needed
140 case Activation:
141 f.scope = v
142 fns, err := FindFunctionActivation(f.scope)
143 if err != nil {
144 frameStack.Put(f)
145 return nil, err
146 }
147 f.functions = fns
148 case map[string]any:
149 f.vars = v
150 default:
151 frameStack.Put(f)
152 return nil, fmt.Errorf("invalid input, wanted Activation or map[string]any, got: (%T)%v", input, input)
153 }
154 return f, nil
155}
156
157// SetContext sets the context for the execution frame.
158func (f *ExecutionFrame) SetContext(ctx context.Context, interruptCheckFrequency uint) error {

Callers 15

newExecutionFrameMethod · 0.92
maybeOptimizeConstUnaryFunction · 0.85
maybeBuildListLiteralFunction · 0.85
maybeBuildMapLiteralFunction · 0.85
TestListMapAccessCostFunction · 0.85
programFunction · 0.85
benchmarkMemoryTrackerFunction · 0.85
runOptionsBenchmarkFunction · 0.85
ObserveEvalMethod · 0.85
EvalActivationFunction · 0.85

Calls 2

FindFunctionActivationFunction · 0.85
GetMethod · 0.65