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

Method Exec

interpreter/interpretable.go:1807–1825  ·  view source on GitHub ↗

Exec implements the InterpretableV2 interface method.

(frame *ExecutionFrame)

Source from the content-addressed store, hash-verified

1805
1806// Exec implements the InterpretableV2 interface method.
1807func (cond *evalExhaustiveConditional) Exec(frame *ExecutionFrame) ref.Val {
1808 cVal := cond.attr.expr.Exec(frame)
1809 tVal, tErr := cond.attr.truthy.Resolve(frame)
1810 fVal, fErr := cond.attr.falsy.Resolve(frame)
1811 cBool, ok := cVal.(types.Bool)
1812 if !ok {
1813 return types.ValOrErr(cVal, "no such overload")
1814 }
1815 if cBool {
1816 if tErr != nil {
1817 return types.LabelErrNode(cond.id, types.WrapErr(tErr))
1818 }
1819 return cond.adapter.NativeToValue(tVal)
1820 }
1821 if fErr != nil {
1822 return types.LabelErrNode(cond.id, types.WrapErr(fErr))
1823 }
1824 return cond.adapter.NativeToValue(fVal)
1825}
1826
1827// Eval implements the Interpretable interface method.
1828func (cond *evalExhaustiveConditional) Eval(ctx Activation) ref.Val {

Callers

nothing calls this directly

Calls 6

ValOrErrFunction · 0.92
LabelErrNodeFunction · 0.92
WrapErrFunction · 0.92
ExecMethod · 0.65
ResolveMethod · 0.65
NativeToValueMethod · 0.65

Tested by

no test coverage detected