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

Method Exec

interpreter/interpretable.go:244–254  ·  view source on GitHub ↗

Exec implements the InterpretableV2 interface method.

(frame *ExecutionFrame)

Source from the content-addressed store, hash-verified

242
243// Exec implements the InterpretableV2 interface method.
244func (test *evalTestOnly) Exec(frame *ExecutionFrame) ref.Val {
245 val, err := test.Resolve(frame)
246 // Return an error if the resolve step fails
247 if err != nil {
248 return types.LabelErrNode(test.id, types.WrapErr(err))
249 }
250 if optVal, isOpt := val.(*types.Optional); isOpt {
251 return types.Bool(optVal.HasValue())
252 }
253 return test.Adapter().NativeToValue(val)
254}
255
256// Eval implements the Interpretable interface method.
257func (test *evalTestOnly) Eval(ctx Activation) ref.Val {

Callers 1

EvalMethod · 0.95

Calls 7

LabelErrNodeFunction · 0.92
WrapErrFunction · 0.92
BoolTypeAlias · 0.92
HasValueMethod · 0.80
ResolveMethod · 0.65
NativeToValueMethod · 0.65
AdapterMethod · 0.65

Tested by

no test coverage detected