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

Method InitState

interpreter/interpreter.go:129–139  ·  view source on GitHub ↗

InitState produces an EvalState instance and bundles it into the ExecutionFrame in a way which is not visible to expression evaluation.

(frame *ExecutionFrame)

Source from the content-addressed store, hash-verified

127// InitState produces an EvalState instance and bundles it into the ExecutionFrame in a way which is
128// not visible to expression evaluation.
129func (et *evalStateFactory) InitState(frame *ExecutionFrame) (any, error) {
130 if frame.ctx != nil && frame.ctx.state != nil {
131 return frame.ctx.state, nil
132 }
133 state := et.factory()
134 if frame.ctx == nil {
135 frame.ctx = evalContextPool.Get().(*evalContext)
136 }
137 frame.ctx.state = state
138 return state, nil
139}
140
141// GetState extracts the EvalState from the Activation.
142func (et *evalStateFactory) GetState(frame *ExecutionFrame) any {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected