From decaddb418abcb6094e339f1b8dd4bb519b761ad Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 16 Mar 2015 23:41:01 -0700 Subject: 941 - c++: basic break/loop conversion --- cpp/012run | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cpp/012run') diff --git a/cpp/012run b/cpp/012run index 8ae164c3..f4dd6390 100644 --- a/cpp/012run +++ b/cpp/012run @@ -36,6 +36,7 @@ void run(routine rr) { vector& instructions = steps(rr); size_t& pc = running_at(rr); // Running one instruction. + if (instructions[pc].is_label) { ++pc; continue; } trace("run") << "instruction " << recipe_name(rr) << '/' << pc; switch (instructions[pc].operation) { // Primitive Recipe Implementations. @@ -140,3 +141,12 @@ size_t size_of(reagent r) { if (!t.is_record && !t.is_array) return t.size; return t.size; // TODO } + +:(scenario run_label) +recipe main [ + +foo + 1:integer <- copy 23:literal + 2:integer <- copy 1:integer +] ++run: instruction main/1 ++run: instruction main/2 -- cgit 1.4.1-2-gfad0