MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Evaluate

Method Evaluate

eval/eval/optional_or_step.cc:165–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165absl::Status OptionalOrStep::Evaluate(ExecutionFrame* frame) const {
166 if (!frame->value_stack().HasEnough(2)) {
167 return absl::InternalError("Value stack underflow");
168 }
169
170 absl::Span<const Value> args = frame->value_stack().GetSpan(2);
171 absl::Span<const AttributeTrail> args_attr =
172 frame->value_stack().GetAttributeSpan(2);
173
174 Value result;
175 AttributeTrail result_attr;
176 CEL_RETURN_IF_ERROR(EvalOptionalOr(kind_, args[0], args[1], args_attr[0],
177 args_attr[1], result, result_attr));
178
179 frame->value_stack().PopAndPush(2, std::move(result), std::move(result_attr));
180 return absl::OkStatus();
181}
182
183class ExhaustiveDirectOptionalOrStep : public DirectExpressionStep {
184 public:

Callers

nothing calls this directly

Calls 9

EvalOptionalOrFunction · 0.85
MakeNoOverloadErrorFunction · 0.85
HasEnoughMethod · 0.80
GetSpanMethod · 0.80
GetAttributeSpanMethod · 0.80
PopAndPushMethod · 0.80
HasValueMethod · 0.80
has_valueMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected