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

Method Exec

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

Source from the content-addressed store, hash-verified

802}
803
804func (opt *evalOptionalOrValue) Exec(frame *interpreter.ExecutionFrame) ref.Val {
805 // short-circuit lhs.
806 optLHS := opt.lhs.Exec(frame)
807
808 switch val := optLHS.(type) {
809 case *types.Err, *types.Unknown:
810 return optLHS
811 case *types.Optional:
812 if val.HasValue() {
813 return val.GetValue()
814 }
815 return opt.rhs.Exec(frame)
816 default:
817 return types.NoSuchOverloadErr()
818 }
819}
820
821// Eval evaluates the left-hand side optional to determine whether it contains a value, else
822// proceeds with the right-hand side evaluation.

Callers 1

EvalMethod · 0.95

Calls 4

NoSuchOverloadErrFunction · 0.92
HasValueMethod · 0.80
GetValueMethod · 0.80
ExecMethod · 0.65

Tested by

no test coverage detected