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

Method InitState

interpreter/interpreter.go:123–130  ·  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

121// InitState produces an EvalState instance and bundles it into the ExecutionFrame in a way which is
122// not visible to expression evaluation.
123func (et *evalStateFactory) InitState(frame *ExecutionFrame) (any, error) {
124 state := et.factory()
125 if frame.ctx == nil {
126 frame.ctx = evalContextPool.Get().(*evalContext)
127 }
128 frame.ctx.state = state
129 return state, nil
130}
131
132// GetState extracts the EvalState from the Activation.
133func (et *evalStateFactory) GetState(frame *ExecutionFrame) any {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected