about summary refs log tree commit diff stats
path: root/html/020run.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-15 01:01:58 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-15 01:01:58 -0700
commit0ca56ed853c3d9bc8c26d1b014d8b665363fc2d0 (patch)
treeabd2d2e4b65c34797a635aeb2f7d06c9d65c7bf9 /html/020run.cc.html
parent36b927a63cb25e9fc64cf4ae079b32d23d528b1b (diff)
downloadmu-0ca56ed853c3d9bc8c26d1b014d8b665363fc2d0.tar.gz
3355
Diffstat (limited to 'html/020run.cc.html')
-rw-r--r--html/020run.cc.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/html/020run.cc.html b/html/020run.cc.html
index bf415da3..a4ddb087 100644
--- a/html/020run.cc.html
+++ b/html/020run.cc.html
@@ -94,10 +94,8 @@ map&lt;string<span class="Delimiter">,</span> <span class="Normal">int</span>&gt
   run_current_routine<span class="Delimiter">();</span>
 <span class="Delimiter">}</span>
 
-<span class="Normal">void</span> run_current_routine<span class="Delimiter">()</span>
-<span class="Delimiter">{</span>  <span class="Comment">// curly on a separate line, because later layers will modify function header</span>
-  <span class="Normal">while</span> <span class="Delimiter">(</span>!Current_routine<span class="Delimiter">-&gt;</span>completed<span class="Delimiter">())</span>  <span class="Comment">// later layers will modify condition</span>
-  <span class="Delimiter">{</span>
+<span class="Normal">void</span> run_current_routine<span class="Delimiter">()</span> <span class="Delimiter">{</span>
+  <span class="Normal">while</span> <span class="Delimiter">(</span>should_continue_running<span class="Delimiter">(</span>Current_routine<span class="Delimiter">))</span> <span class="Delimiter">{</span>  <span class="Comment">// beware: later layers modify Current_routine here</span>
     <span class="Comment">// Running One Instruction</span>
     <span class="Normal">if</span> <span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>is_label<span class="Delimiter">)</span> <span class="Delimiter">{</span> ++current_step_index<span class="Delimiter">();</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Delimiter">}</span>
     trace<span class="Delimiter">(</span>Initial_callstack_depth + Trace_stream<span class="Delimiter">-&gt;</span>callstack_depth<span class="Delimiter">,</span> <span class="Constant">&quot;run&quot;</span><span class="Delimiter">)</span> &lt;&lt; to_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> &lt;&lt; end<span class="Delimiter">();</span>
@@ -140,6 +138,11 @@ map&lt;string<span class="Delimiter">,</span> <span class="Normal">int</span>&gt
   <span class="Normal">stop_running_current_routine</span>:<span class="Delimiter">;</span>
 <span class="Delimiter">}</span>
 
+<span class="Normal">bool</span> should_continue_running<span class="Delimiter">(</span><span class="Normal">const</span> routine* current_routine<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+  assert<span class="Delimiter">(</span>current_routine == Current_routine<span class="Delimiter">);</span>  <span class="Comment">// argument passed in just to make caller readable above</span>
+  <span class="Identifier">return</span> !Current_routine<span class="Delimiter">-&gt;</span>completed<span class="Delimiter">();</span>
+<span class="Delimiter">}</span>
+
 <span class="Normal">bool</span> should_copy_ingredients<span class="Delimiter">()</span> <span class="Delimiter">{</span>
   <span class="Comment">// End should_copy_ingredients Special-cases</span>
   <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>