about summary refs log tree commit diff stats
path: root/cpp/020run
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-24 20:00:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-24 20:00:56 -0700
commit69e14325e3eaa3722766bb9706d7da5862b6ea26 (patch)
tree202dca5ebbdb49db1352215aac9887b5e1afa2da /cpp/020run
parentb75e94b317509b26d60223db6cf8f388890a79fb (diff)
downloadmu-69e14325e3eaa3722766bb9706d7da5862b6ea26.tar.gz
1170
Diffstat (limited to 'cpp/020run')
-rw-r--r--cpp/020run7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/020run b/cpp/020run
index d5a161d1..e4ffafc7 100644
--- a/cpp/020run
+++ b/cpp/020run
@@ -34,6 +34,7 @@ struct routine {
   recipe_number running_recipe;
   size_t running_at;
   routine(recipe_number r) :running_recipe(r), running_at(0) {}
+  bool completed() const;
 };
 
 :(before "End Globals")
@@ -48,7 +49,7 @@ void run(recipe_number r) {
 
 void run_current_routine()
 {  // curly on a separate line, because later layers will modify header
-  while (!done())  // later layers will modify condition
+  while (!Current_routine->completed())  // later layers will modify condition
   {
     // Running One Instruction.
     vector<instruction>& instructions = steps();
@@ -95,8 +96,8 @@ inline vector<instruction>& steps() {
   return Recipe[Current_routine->running_recipe].steps;
 }
 
-inline bool done() {
-  return running_at() >= steps().size();
+inline bool routine::completed() const {
+  return running_step_index >= Recipe[running_recipe].steps.size();
 }
 
 :(before "End Commandline Parsing")