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

Method Exec

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

Source from the content-addressed store, hash-verified

1057}
1058
1059func (opt *evalOptionalOrValue) Exec(frame *interpreter.ExecutionFrame) ref.Val {
1060 // short-circuit lhs.
1061 optLHS := opt.lhs.Exec(frame)
1062
1063 switch val := optLHS.(type) {
1064 case *types.Err, *types.Unknown:
1065 return optLHS
1066 case *types.Optional:
1067 if val.HasValue() {
1068 return val.GetValue()
1069 }
1070 return opt.rhs.Exec(frame)
1071 default:
1072 return types.NoSuchOverloadErr()
1073 }
1074}
1075
1076// Eval evaluates the left-hand side optional to determine whether it contains a value, else
1077// proceeds with the right-hand side evaluation.

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected