| 242 | } |
| 243 | |
| 244 | absl::StatusOr<Value> AbstractFunctionStep::DoEvaluate( |
| 245 | ExecutionFrame* frame) const { |
| 246 | // Create Span object that contains input arguments to the function. |
| 247 | auto input_args = frame->value_stack().GetSpan(num_arguments_); |
| 248 | |
| 249 | std::vector<cel::Value> unknowns_args; |
| 250 | // Preprocess args. If an argument is partially unknown, convert it to an |
| 251 | // unknown attribute set. |
| 252 | if (frame->enable_unknowns()) { |
| 253 | auto input_attrs = frame->value_stack().GetAttributeSpan(num_arguments_); |
| 254 | unknowns_args = CheckForPartialUnknowns(frame, input_args, input_attrs); |
| 255 | input_args = absl::MakeConstSpan(unknowns_args); |
| 256 | } |
| 257 | |
| 258 | // Derived class resolves to a single function overload or none. |
| 259 | CEL_ASSIGN_OR_RETURN(ResolveResult matched_function, |
| 260 | ResolveFunction(input_args, frame)); |
| 261 | |
| 262 | // Overload found and is allowed to consume the arguments. |
| 263 | if (matched_function.has_value() && |
| 264 | ShouldAcceptOverload(matched_function->descriptor, input_args)) { |
| 265 | return Invoke(*matched_function, id(), input_args, *frame); |
| 266 | } |
| 267 | |
| 268 | return NoOverloadResult(name_, input_args, receiver_style_, *frame); |
| 269 | } |
| 270 | |
| 271 | absl::Status AbstractFunctionStep::Evaluate(ExecutionFrame* frame) const { |
| 272 | if (!frame->value_stack().HasEnough(num_arguments_)) { |
nothing calls this directly
no test coverage detected