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

Method Exec

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

Source from the content-addressed store, hash-verified

1022}
1023
1024func (opt *evalOptionalOr) Exec(frame *interpreter.ExecutionFrame) ref.Val {
1025 // short-circuit lhs.
1026 optLHS := opt.lhs.Exec(frame)
1027 switch val := optLHS.(type) {
1028 case *types.Err, *types.Unknown:
1029 return optLHS
1030 case *types.Optional:
1031 if val.HasValue() {
1032 return optLHS
1033 }
1034 return opt.rhs.Exec(frame)
1035 default:
1036 return types.NoSuchOverloadErr()
1037 }
1038}
1039
1040// Eval evaluates the left-hand side optional to determine whether it contains a value, else
1041// proceeds with the right-hand side evaluation.

Callers

nothing calls this directly

Calls 3

NoSuchOverloadErrFunction · 0.92
HasValueMethod · 0.80
ExecMethod · 0.65

Tested by

no test coverage detected