about summary refs log tree commit diff stats
path: root/020run.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-11 20:24:14 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-11 20:26:46 -0700
commitccba671853b44147a95138581c580fce76653e57 (patch)
tree1d92fc4a2c1ea667fba2abad8be799f5916d7784 /020run.cc
parentb3899909d60fb6dc48cef73d6d28dbd89fe72442 (diff)
downloadmu-ccba671853b44147a95138581c580fce76653e57.tar.gz
3335
Clean up rest of long-standing bit of ugliness.

I'm growing more confident now that I can use layers to cleanly add any
functionality I want. All I need is hook functions. No need to ever put
'{' on their own line, or add arguments to calls.
Diffstat (limited to '020run.cc')
-rw-r--r--020run.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/020run.cc b/020run.cc
index e60e75ac..8f27c820 100644
--- a/020run.cc
+++ b/020run.cc
@@ -57,8 +57,7 @@ void run(recipe_ordinal r) {
 }
 
 void run_current_routine() {
-  while (!Current_routine->completed())  // later layers will modify condition
-  {
+  while (should_continue_running(Current_routine)) {  // beware: later layers modify Current_routine here
     // Running One Instruction
     if (current_instruction().is_label) { ++current_step_index(); continue; }
     trace(Initial_callstack_depth + Trace_stream->callstack_depth, "run") << to_string(current_instruction()) << end();
@@ -101,6 +100,11 @@ void run_current_routine() {
   stop_running_current_routine:;
 }
 
+bool should_continue_running(const routine* current_routine) {
+  assert(current_routine == Current_routine);  // argument passed in just to make caller readable above
+  return !Current_routine->completed();
+}
+
 bool should_copy_ingredients() {
   // End should_copy_ingredients Special-cases
   return true;
58120fe3547d8e5431d9abfe46bf8'>^
8f1db754 ^
1ead3562 ^
9867dff4 ^
f40137f1 ^
263e6b2a ^
f40137f1 ^
263e6b2a ^
f40137f1 ^
263e6b2a ^
8f1db754 ^
e4fc73b1 ^


8f1db754 ^



b24eb476 ^


263e6b2a ^
8f1db754 ^

b24eb476 ^
d0e29245 ^
82ac0b7e ^
b24eb476 ^
82ac0b7e ^
8f1db754 ^

b24eb476 ^
6c96a437 ^
0487a30e ^
ae256ea1 ^
9dcbec39 ^
ae256ea1 ^
0487a30e ^
8f1db754 ^


047296d8 ^

1ead3562 ^
192d59d3 ^
047296d8 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65