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

Function AsFrame

interpreter/interpretable.go:199–210  ·  view source on GitHub ↗

AsFrame promotes an Activation to an ExecutionFrame.

(a Activation)

Source from the content-addressed store, hash-verified

197
198// AsFrame promotes an Activation to an ExecutionFrame.
199func AsFrame(a Activation) *ExecutionFrame {
200 if f, ok := a.(*ExecutionFrame); ok {
201 return f
202 }
203 frame := &ExecutionFrame{Activation: a}
204 // Walk the activation hierarchy to find a parent ExecutionFrame and inherit
205 // its shared context.
206 if parent := findFrame(a); parent != nil {
207 frame.ctx = parent.ctx
208 }
209 return frame
210}
211
212// findFrame walks the activation hierarchy via Unwrap and Parent to locate an
213// existing ExecutionFrame, if one exists.

Callers 15

EvalMethod · 0.92
EvalMethod · 0.92
EvalMethod · 0.92
EvalMethod · 0.92
computeCostFunction · 0.85
ObserveMethod · 0.85
programFunction · 0.85
EvalMethod · 0.85
ObserveEvalMethod · 0.85
EvalMethod · 0.85
EvalMethod · 0.85
EvalMethod · 0.85

Calls 1

findFrameFunction · 0.85

Tested by 2

computeCostFunction · 0.68
programFunction · 0.68