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

Method Next

eval/eval/evaluator_core.cc:42–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42const ExpressionStep* ExecutionFrame::Next() {
43 while (true) {
44 const size_t end_pos = execution_path_.size();
45
46 if (ABSL_PREDICT_TRUE(pc_ < end_pos)) {
47 const auto* step = execution_path_[pc_++].get();
48 ABSL_ASSUME(step != nullptr);
49 return step;
50 }
51 if (ABSL_PREDICT_TRUE(pc_ == end_pos)) {
52 if (!call_stack_.empty()) {
53 SubFrame& subframe = call_stack_.back();
54 pc_ = subframe.return_pc;
55 execution_path_ = subframe.return_expression;
56 ABSL_DCHECK_EQ(value_stack().size(), subframe.expected_stack_size);
57 comprehension_slots().Set(subframe.slot_index, value_stack().Peek(),
58 value_stack().PeekAttribute());
59 call_stack_.pop_back();
60 continue;
61 }
62 } else {
63 ABSL_LOG(ERROR) << "Attempting to step beyond the end of execution path.";
64 }
65 return nullptr;
66 }
67}
68
69namespace {
70

Callers 5

TESTFunction · 0.45
MinListFunction · 0.45
MaxListFunction · 0.45
TEST_FFunction · 0.45
ASSERT_OK_AND_ASSIGNFunction · 0.45

Calls 5

sizeMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45
SetMethod · 0.45
PeekMethod · 0.45

Tested by 3

TESTFunction · 0.36
TEST_FFunction · 0.36
ASSERT_OK_AND_ASSIGNFunction · 0.36