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

Method Push

interpreter/frame.go:213–223  ·  view source on GitHub ↗

Push pushes the given activation onto the activation stack and returns the new frame. This operation is internal to the interpreter and is used to handle comprehension and block scoping. The child frame inherits the shared evalContext from the parent.

(activation Activation)

Source from the content-addressed store, hash-verified

211// This operation is internal to the interpreter and is used to handle comprehension
212// and block scoping. The child frame inherits the shared evalContext from the parent.
213func (f *ExecutionFrame) Push(activation Activation) *ExecutionFrame {
214 child := frameStack.Get().(*ExecutionFrame)
215 child.parent = f
216 child.ctx = f.ctx
217 child.costTracker = f.costTracker
218 child.scope = activation
219 // Scopes pushed during evaluation never supply late-bound functions, so the child inherits
220 // the bindings resolved for the evaluation rather than searching its own hierarchy.
221 child.functions = f.functions
222 return child
223}
224
225// Pop returns the parent frame, releasing the current frame back to the pool.
226func (f *ExecutionFrame) Pop() *ExecutionFrame {

Callers 10

newFolderFunction · 0.45
TestFrameResolveNameFunction · 0.45
TestFrameParentFunction · 0.45
TestFrameUnwrapFunction · 0.45
TestFramePushPopFunction · 0.45

Calls 1

GetMethod · 0.65

Tested by 9

TestFrameResolveNameFunction · 0.36
TestFrameParentFunction · 0.36
TestFrameUnwrapFunction · 0.36
TestFramePushPopFunction · 0.36