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

Method Exec

cel/library.go:732–746  ·  view source on GitHub ↗
(frame *interpreter.ExecutionFrame)

Source from the content-addressed store, hash-verified

730}
731
732func (opt *evalOptionalOr) Exec(frame *interpreter.ExecutionFrame) ref.Val {
733 // short-circuit lhs.
734 optLHS := opt.lhs.Exec(frame)
735 switch val := optLHS.(type) {
736 case *types.Err, *types.Unknown:
737 return optLHS
738 case *types.Optional:
739 if val.HasValue() {
740 return optLHS
741 }
742 return opt.rhs.Exec(frame)
743 default:
744 return types.NoSuchOverloadErr()
745 }
746}
747
748// Eval evaluates the left-hand side optional to determine whether it contains a value, else
749// proceeds with the right-hand side evaluation.

Callers 1

EvalMethod · 0.95

Calls 3

NoSuchOverloadErrFunction · 0.92
HasValueMethod · 0.80
ExecMethod · 0.65

Tested by

no test coverage detected