about summary refs log tree commit diff stats
path: root/cpp
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-24 20:52:06 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-24 20:52:06 -0700
commit5eb49929b0ccc3b1660e9d7d26ba5adec363fb68 (patch)
tree551cbff0c6139ed6b8aee9ed559f946ddb85a11c /cpp
parent0d7b60ed1dd71d48777b86d01849767f69fd2511 (diff)
downloadmu-5eb49929b0ccc3b1660e9d7d26ba5adec363fb68.tar.gz
1179
Diffstat (limited to 'cpp')
-rw-r--r--cpp/020run4
-rw-r--r--cpp/035call11
2 files changed, 6 insertions, 9 deletions
diff --git a/cpp/020run b/cpp/020run
index 738545ee..2f08b23c 100644
--- a/cpp/020run
+++ b/cpp/020run
@@ -86,10 +86,6 @@ inline const string& current_recipe_name() {
   return Recipe[Current_routine->running_recipe].name;
 }
 
-inline vector<instruction>& steps() {
-  return Recipe[Current_routine->running_recipe].steps;
-}
-
 inline const instruction& current_instruction() {
   return Recipe[Current_routine->running_recipe].steps[Current_routine->running_step_index];
 }
diff --git a/cpp/035call b/cpp/035call
index 9aee3db8..2f9b0f15 100644
--- a/cpp/035call
+++ b/cpp/035call
@@ -45,6 +45,7 @@ struct routine {
   // End routine Fields
   routine(recipe_number r);
   bool completed() const;
+  const vector<instruction>& steps() const;
 };
 :(code)
   routine::routine(recipe_number r) {
@@ -61,10 +62,6 @@ inline size_t& current_step_index() {
 inline const string& current_recipe_name() {
   return Recipe[Current_routine->calls.top().running_recipe].name;
 }
-:(replace{} "inline vector<instruction>& steps()")
-inline vector<instruction>& steps() {
-  return Recipe[Current_routine->calls.top().running_recipe].steps;
-}
 :(replace{} "inline const instruction& current_instruction()")
 inline const instruction& current_instruction() {
   return Recipe[Current_routine->calls.top().running_recipe].steps[Current_routine->calls.top().running_step_index];
@@ -88,10 +85,14 @@ inline bool routine::completed() const {
   return calls.empty();
 }
 
+inline const vector<instruction>& routine::steps() const {
+  return Recipe[calls.top().running_recipe].steps;
+}
+
 :(before "Running One Instruction")
 // when we reach the end of one call, we may reach the end of the one below
 // it, and the one below that, and so on
-while (current_step_index() >= steps().size()) {
+while (current_step_index() >= Current_routine->steps().size()) {
   Current_routine->calls.pop();
   if (Current_routine->calls.empty()) return;
   // todo: no results returned warning
c64f9855262c4a9511025dffcc1d603c7206'>e10fc64 ^
5e92b61 ^
a6c8162 ^
5e92b61 ^
c050730 ^
e10fc64 ^
6753171 ^
c050730 ^

e10fc64 ^

7f76158 ^
e10fc64 ^
5e92b61 ^
a6c8162 ^

e10fc64 ^





a6c8162 ^





979e1f9 ^
a6c8162 ^
6753171 ^
6753171 ^
6753171 ^

bc6811a ^
6753171 ^
bc6811a ^



6753171 ^
6753171 ^


bc6811a ^

6753171 ^






7f76158 ^
6753171 ^

e10fc64 ^
6753171 ^
6753171 ^
6753171 ^
6753171 ^
6753171 ^
45d6723 ^
6753171 ^




6753171 ^
2fd6b1a ^
bc6811a ^

2fd6b1a ^
37142b5 ^
7db28dd ^


2fd6b1a ^
bc6811a ^




7db28dd ^
bc6811a ^


37142b5 ^
7db28dd ^
bc6811a ^



f56b111 ^












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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145