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

Function findFrame

interpreter/interpretable.go:214–229  ·  view source on GitHub ↗

findFrame walks the activation hierarchy via Unwrap and Parent to locate an existing ExecutionFrame, if one exists.

(a Activation)

Source from the content-addressed store, hash-verified

212// findFrame walks the activation hierarchy via Unwrap and Parent to locate an
213// existing ExecutionFrame, if one exists.
214func findFrame(a Activation) *ExecutionFrame {
215 if wrapper, ok := a.(activationWrapper); ok {
216 unwrapped := wrapper.Unwrap()
217 if f, ok := unwrapped.(*ExecutionFrame); ok {
218 return f
219 }
220 return findFrame(unwrapped)
221 }
222 if p := a.Parent(); p != nil {
223 if f, ok := p.(*ExecutionFrame); ok {
224 return f
225 }
226 return findFrame(p)
227 }
228 return nil
229}
230
231// Core Interpretable implementations used during the program planning phase.
232

Callers 2

TestFindFrameFunction · 0.85
AsFrameFunction · 0.85

Calls 2

UnwrapMethod · 0.65
ParentMethod · 0.65

Tested by 1

TestFindFrameFunction · 0.68