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

Method ReplaceSubplan

eval/compiler/flat_expr_builder_extensions.cc:422–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422absl::Status PlannerContext::ReplaceSubplan(const cel::Expr& node,
423 ExecutionPath path) {
424 auto* subexpression = program_builder_.GetSubexpression(&node);
425 if (subexpression == nullptr) {
426 return absl::InternalError(
427 "attempted to update program step for untracked expr node");
428 }
429
430 // Make sure structure for descendents is erased.
431 if (!subexpression->IsFlattened()) {
432 subexpression->Flatten();
433 }
434
435 subexpression->flattened_elements() = std::move(path);
436
437 return absl::OkStatus();
438}
439
440void ProgramBuilder::Reset() {
441 root_ = nullptr;

Callers 4

OnPostVisitMethod · 0.80
TEST_FFunction · 0.80
OnPostVisitMethod · 0.80

Calls 3

IsFlattenedMethod · 0.80
set_recursive_programMethod · 0.80
FlattenMethod · 0.45

Tested by 1

TEST_FFunction · 0.64