about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-01-06 22:09:29 -0800
committerKartik K. Agaram <vc@akkartik.com>2017-01-06 22:09:29 -0800
commit61fb1da0b624ce20960c5e8b2229ca3d7f0e4fcd (patch)
tree327fecd98e3e6c7096fe0854f557c95b20a0046d
parent58f19b4c41f5c4ca9fec1515fe5e24732eda19b7 (diff)
downloadmu-61fb1da0b624ce20960c5e8b2229ca3d7f0e4fcd.tar.gz
3730
Properly support reloading lessons containing scenarios in edit/ and
sandbox/ apps.

I was so sure I tested this for commit 3724, but apparently not.
-rw-r--r--101run_sandboxed.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/101run_sandboxed.cc b/101run_sandboxed.cc
index a3b6292e..d6680f0e 100644
--- a/101run_sandboxed.cc
+++ b/101run_sandboxed.cc
@@ -135,6 +135,8 @@ map<type_ordinal, type_info> Type_snapshot_stash;
 map<recipe_ordinal, map<string, int> > Name_snapshot_stash;
 map<string, vector<recipe_ordinal> > Recipe_variants_snapshot_stash;
 map<string, type_tree*> Type_abbreviations_snapshot_stash;
+vector<scenario> Scenarios_snapshot_stash;
+set<string> Scenario_names_snapshot_stash;
 
 :(code)
 void run_code_begin(bool should_stash_snapshots) {
@@ -179,6 +181,10 @@ void stash_snapshots() {
   Recipe_variants_snapshot_stash = Recipe_variants_snapshot;
   assert(Type_abbreviations_snapshot_stash.empty());
   Type_abbreviations_snapshot_stash = Type_abbreviations_snapshot;
+  assert(Scenarios_snapshot_stash.empty());
+  Scenarios_snapshot_stash = Scenarios_snapshot;
+  assert(Scenario_names_snapshot_stash.empty());
+  Scenario_names_snapshot_stash = Scenario_names_snapshot;
   save_snapshots();
 }
 void unstash_snapshots() {
@@ -190,6 +196,8 @@ void unstash_snapshots() {
   Name_snapshot = Name_snapshot_stash;  Name_snapshot_stash.clear();
   Recipe_variants_snapshot = Recipe_variants_snapshot_stash;  Recipe_variants_snapshot_stash.clear();
   Type_abbreviations_snapshot = Type_abbreviations_snapshot_stash;  Type_abbreviations_snapshot_stash.clear();
+  Scenarios_snapshot = Scenarios_snapshot_stash;  Scenarios_snapshot_stash.clear();
+  Scenario_names_snapshot = Scenario_names_snapshot_stash;  Scenario_names_snapshot_stash.clear();
 }
 
 :(before "End Load Recipes")
1b5e'>^
bff0fa45 ^
2b250717 ^
bff0fa45 ^


9dcbec39 ^
bff0fa45 ^

4e49b29e ^

98f7918b ^

0487a30e ^
6c96a437 ^
23d3a022 ^
0487a30e ^
827898fc ^
98f7918b ^

23d3a022 ^





98f7918b ^
4a943d4e ^











98f7918b ^
4a943d4e ^









0487a30e ^
4a943d4e ^









0487a30e ^
4a943d4e ^









0487a30e ^
1848b18f ^

98f7918b ^
795f5244 ^
e236973b ^
4e49b29e ^
6c96a437 ^
4e49b29e ^
9dcbec39 ^
4e49b29e ^


bff0fa45 ^
2b250717 ^
bff0fa45 ^


9dcbec39 ^
bff0fa45 ^

4e49b29e ^

98f7918b ^

0487a30e ^
6c96a437 ^
23d3a022 ^
0487a30e ^
827898fc ^
98f7918b ^


4a943d4e ^












d7e11237 ^
4a943d4e ^









0487a30e ^
4a943d4e ^









0487a30e ^
4a943d4e ^









0487a30e ^
1848b18f ^

d7e11237 ^
795f5244 ^
e236973b ^
4e49b29e ^
67a180e3 ^
2b250717 ^
4e49b29e ^

6c96a437 ^
23d3a022 ^

4e49b29e ^


6c96a437 ^
bff0fa45 ^

9dcbec39 ^
bff0fa45 ^


4e49b29e ^

d7e11237 ^

e4630643 ^
6c96a437 ^
23d3a022 ^
0487a30e ^
d7e11237 ^


4a943d4e ^











0487a30e ^
4a943d4e ^











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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224