| 420 | } |
| 421 | |
| 422 | absl::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 | |
| 440 | void ProgramBuilder::Reset() { |
| 441 | root_ = nullptr; |