diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-17 15:01:51 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-17 15:01:51 -0700 |
commit | f344b250f6f062a1a1902bf69b23ebf9b565de0e (patch) | |
tree | 199bd32a9aee198d5028b1c21b83d2cf0944b2b6 /html/101run_sandboxed.cc.html | |
parent | 897ae8c1855f830d8819759ea327d147f28a09bf (diff) | |
download | mu-f344b250f6f062a1a1902bf69b23ebf9b565de0e.tar.gz |
3395
Diffstat (limited to 'html/101run_sandboxed.cc.html')
-rw-r--r-- | html/101run_sandboxed.cc.html | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/html/101run_sandboxed.cc.html b/html/101run_sandboxed.cc.html index bf39a10e..e12ec509 100644 --- a/html/101run_sandboxed.cc.html +++ b/html/101run_sandboxed.cc.html @@ -38,17 +38,17 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Delimiter">:(scenario run_interactive_code)</span> def main [ - <span class="Constant">1</span>:number/<span class="Special">raw <- </span>copy <span class="Constant">0</span> - <span class="Constant">2</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [<span class="Constant">1</span>:number/<span class="Special">raw <- </span>copy <span class="Constant">34</span>] - run-sandboxed <span class="Constant">2</span>:address:array:character - <span class="Constant">3</span>:number/<span class="Special">raw <- </span>copy <span class="Constant">1</span>:number/<span class="Special">raw</span> + <span class="Constant">1</span>:num/<span class="Special">raw <- </span>copy <span class="Constant">0</span> + <span class="Constant">2</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [<span class="Constant">1</span>:num/<span class="Special">raw <- </span>copy <span class="Constant">34</span>] + run-sandboxed <span class="Constant">2</span>:text + <span class="Constant">3</span>:num/<span class="Special">raw <- </span>copy <span class="Constant">1</span>:num/<span class="Special">raw</span> ] <span class="traceContains">+mem: storing 34 in location 3</span> <span class="Delimiter">:(scenario run_interactive_empty)</span> def main [ - <span class="Constant">1</span>:address:array:character<span class="Special"> <- </span>copy <span class="Constant">0</span>/unsafe - <span class="Constant">2</span>:address:array:character<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:address:array:character + <span class="Constant">1</span>:text<span class="Special"> <- </span>copy <span class="Constant">0</span>/unsafe + <span class="Constant">2</span>:text<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:text ] <span class="Comment"># result is null</span> <span class="traceContains">+mem: storing 0 in location 2</span> @@ -79,7 +79,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span raise << maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'run-sandboxed' requires exactly one ingredient, but got '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_string<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> raise << maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"first ingredient of 'run-sandboxed' should be a string, but got '"</span> << to_string<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -130,7 +130,7 @@ string Save_trace_file<span class="Delimiter">;</span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">1</span><span class="Delimiter">;</span> i < Reserved_for_tests<span class="Delimiter">;</span> ++i<span class="Delimiter">)</span> Memory<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span class="Delimiter">}</span> - string command = trim<span class="Delimiter">(</span>strip_comments<span class="Delimiter">(</span>read_mu_string<span class="Delimiter">(</span>address<span class="Delimiter">)));</span> + string command = trim<span class="Delimiter">(</span>strip_comments<span class="Delimiter">(</span>read_mu_text<span class="Delimiter">(</span>address<span class="Delimiter">)));</span> Name[get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"interactive"</span><span class="Delimiter">)</span>]<span class="Delimiter">.</span>clear<span class="Delimiter">();</span> run_code_begin<span class="Delimiter">(</span><span class="Comment">/*</span><span class="Comment">should_stash_snapshots</span><span class="Comment">*/</span><span class="Constant">true</span><span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>command<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> @@ -140,7 +140,7 @@ string Save_trace_file<span class="Delimiter">;</span> <span class="Comment">// call run(string) but without the scheduling</span> load<span class="Delimiter">(</span>string<span class="Delimiter">(</span><span class="Constant">"recipe! interactive [</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">)</span> + <span class="Constant">"new-default-space</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Comment">// disable automatic abandon so tests can see changes</span> - <span class="Constant">"screen:address:screen <- next-ingredient</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"screen:&:screen <- next-ingredient</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"$start-tracking-products</span><span class="cSpecial">\n</span><span class="Constant">"</span> + command + <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"$stop-tracking-products</span><span class="cSpecial">\n</span><span class="Constant">"</span> + @@ -229,17 +229,17 @@ load<span class="Delimiter">(</span>string<span class="Delimiter">(</span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"recipe sandbox [</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"local-scope</span><span class="cSpecial">\n</span><span class="Constant">"</span> + - <span class="Constant">"screen:address:screen <- new-fake-screen 30, 5</span><span class="cSpecial">\n</span><span class="Constant">"</span> + - <span class="Constant">"routine-id:number <- start-running interactive, screen</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"screen:&:screen <- new-fake-screen 30, 5</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"routine-id:num <- start-running interactive, screen</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"limit-time routine-id, 100000/instructions</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"wait-for-routine routine-id</span><span class="cSpecial">\n</span><span class="Constant">"</span> + - <span class="Constant">"instructions-run:number <- number-of-instructions routine-id</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"instructions-run:num <- number-of-instructions routine-id</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"stash instructions-run [instructions run]</span><span class="cSpecial">\n</span><span class="Constant">"</span> + - <span class="Constant">"sandbox-state:number <- routine-state routine-id</span><span class="cSpecial">\n</span><span class="Constant">"</span> + - <span class="Constant">"completed?:boolean <- equal sandbox-state, 1/completed</span><span class="cSpecial">\n</span><span class="Constant">"</span> + - <span class="Constant">"output:address:array:character <- $most-recent-products</span><span class="cSpecial">\n</span><span class="Constant">"</span> + - <span class="Constant">"errors:address:array:character <- save-errors</span><span class="cSpecial">\n</span><span class="Constant">"</span> + - <span class="Constant">"stashes:address:array:character <- save-app-trace</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"sandbox-state:num <- routine-state routine-id</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"completed?:bool <- equal sandbox-state, 1/completed</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"output:text <- $most-recent-products</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"errors:text <- save-errors</span><span class="cSpecial">\n</span><span class="Constant">"</span> + + <span class="Constant">"stashes:text <- save-app-trace</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"$cleanup-run-sandboxed</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"return output, errors, screen, stashes, completed?</span><span class="cSpecial">\n</span><span class="Constant">"</span> + <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> @@ -250,10 +250,10 @@ load<span class="Delimiter">(</span>string<span class="Delimiter">(</span> <span class="Delimiter">:(scenario run_interactive_comments)</span> def main [ - <span class="Constant">1</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [<span class="Comment"># ab</span> + <span class="Constant">1</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [<span class="Comment"># ab</span> add <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">2</span>] - <span class="Constant">2</span>:address:array:character<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:address:array:character - <span class="Constant">3</span>:array:character<span class="Special"> <- </span>copy *<span class="Constant">2</span>:address:array:character + <span class="Constant">2</span>:text<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:text + <span class="Constant">3</span>:@:<span class="Normal">char</span><span class="Special"> <- </span>copy *<span class="Constant">2</span>:text ] <span class="traceContains">+mem: storing 52 in location 4</span> @@ -296,7 +296,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> <span class="Normal">case</span> _MOST_RECENT_PRODUCTS: <span class="Delimiter">{</span> products<span class="Delimiter">.</span>resize<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> - products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>push_back<span class="Delimiter">(</span>new_mu_string<span class="Delimiter">(</span>Most_recent_products<span class="Delimiter">));</span> + products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>push_back<span class="Delimiter">(</span>new_mu_text<span class="Delimiter">(</span>Most_recent_products<span class="Delimiter">));</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -347,9 +347,9 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">:(scenario "run_interactive_converts_result_to_text")</span> def main [ <span class="Comment"># try to interactively add 2 and 2</span> - <span class="Constant">1</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [add <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">2</span>] - <span class="Constant">2</span>:address:array:character<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:address:array:character - <span class="Constant">10</span>:array:character<span class="Special"> <- </span>copy <span class="Constant">2</span>:address:array:character/lookup + <span class="Constant">1</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [add <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">2</span>] + <span class="Constant">2</span>:text<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:text + <span class="Constant">10</span>:@:<span class="Normal">char</span><span class="Special"> <- </span>copy <span class="Constant">2</span>:text/lookup ] <span class="Comment"># first letter in the output should be '4' in unicode</span> <span class="traceContains">+mem: storing 52 in location 11</span> @@ -357,13 +357,13 @@ def main [ <span class="Delimiter">:(scenario "run_interactive_returns_text")</span> def main [ <span class="Comment"># try to interactively add 2 and 2</span> - <span class="Constant">1</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [ - <span class="Normal">x</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [a] - <span class="Normal">y</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [b] - <span class="Normal">z</span>:address:array:character<span class="Special"> <- </span>append x:address:array:character<span class="Delimiter">,</span> y:address:array:character + <span class="Constant">1</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [ + <span class="Normal">x</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [a] + <span class="Normal">y</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [b] + <span class="Normal">z</span>:text<span class="Special"> <- </span>append x:text<span class="Delimiter">,</span> y:text ] - <span class="Constant">2</span>:address:array:character<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:address:array:character - <span class="Constant">10</span>:array:character<span class="Special"> <- </span>copy <span class="Constant">2</span>:address:array:character/lookup + <span class="Constant">2</span>:text<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:text + <span class="Constant">10</span>:@:<span class="Normal">char</span><span class="Special"> <- </span>copy <span class="Constant">2</span>:text/lookup ] <span class="Comment"># output contains "ab"</span> <span class="traceContains">+mem: storing 97 in location 11</span> @@ -372,10 +372,10 @@ def main [ <span class="Delimiter">:(scenario "run_interactive_returns_errors")</span> def main [ <span class="Comment"># run a command that generates an error</span> - <span class="Constant">1</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [x:number<span class="Special"> <- </span>copy <span class="Constant">34</span> -get x:number<span class="Delimiter">,</span> foo:offset] - <span class="Constant">2</span>:address:array:character<span class="Delimiter">,</span> <span class="Constant">3</span>:address:array:character<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:address:array:character - <span class="Constant">10</span>:array:character<span class="Special"> <- </span>copy <span class="Constant">3</span>:address:array:character/lookup + <span class="Constant">1</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [x:num<span class="Special"> <- </span>copy <span class="Constant">34</span> +get x:num<span class="Delimiter">,</span> foo:offset] + <span class="Constant">2</span>:text<span class="Delimiter">,</span> <span class="Constant">3</span>:text<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:text + <span class="Constant">10</span>:@:<span class="Normal">char</span><span class="Special"> <- </span>copy <span class="Constant">3</span>:text/lookup ] <span class="Comment"># error should be "unknown element foo in container number"</span> <span class="traceContains">+mem: storing 117 in location 11</span> @@ -387,10 +387,10 @@ get x:number<span class="Delimiter">,</span> foo:offset] <span class="Delimiter">:(scenario run_interactive_with_comment)</span> def main [ <span class="Comment"># 2 instructions, with a comment after the first</span> - <span class="Constant">1</span>:address:array:number<span class="Special"> <- </span><span class="Normal">new</span> [a:number<span class="Special"> <- </span>copy <span class="Constant">0</span> <span class="Comment"># abc</span> -<span class="Normal">b</span>:number<span class="Special"> <- </span>copy <span class="Constant">0</span> + <span class="Constant">1</span>:&:@:num<span class="Special"> <- </span><span class="Normal">new</span> [a:num<span class="Special"> <- </span>copy <span class="Constant">0</span> <span class="Comment"># abc</span> +<span class="Normal">b</span>:num<span class="Special"> <- </span>copy <span class="Constant">0</span> ] - <span class="Constant">2</span>:address:array:character<span class="Delimiter">,</span> <span class="Constant">3</span>:address:array:character<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:address:array:character + <span class="Constant">2</span>:text<span class="Delimiter">,</span> <span class="Constant">3</span>:text<span class="Special"> <- </span>run-sandboxed <span class="Constant">1</span>:text ] <span class="Comment"># no errors</span> <span class="traceContains">+mem: storing 0 in location 3</span> @@ -414,9 +414,9 @@ def main [ <span class="Comment">// x:text <- new [abc]</span> <span class="Comment">// => abc</span> <span class="Normal">if</span> <span class="Delimiter">(</span>i < SIZE<span class="Delimiter">(</span>instruction<span class="Delimiter">.</span>products<span class="Delimiter">))</span> <span class="Delimiter">{</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_string<span class="Delimiter">(</span>instruction<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_text<span class="Delimiter">(</span>instruction<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!scalar<span class="Delimiter">(</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// error handled elsewhere</span> - out << read_mu_string<span class="Delimiter">(</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> + out << read_mu_text<span class="Delimiter">(</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> <span class="Delimiter">}</span> @@ -446,7 +446,7 @@ string strip_comments<span class="Delimiter">(</span>string in<span class="Delim <span class="Comment">// convert to string</span> ostringstream out<span class="Delimiter">;</span> out << no_scientific<span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address<span class="Delimiter">));</span> - <span class="Identifier">return</span> new_mu_string<span class="Delimiter">(</span>out<span class="Delimiter">.</span>str<span class="Delimiter">());</span> + <span class="Identifier">return</span> new_mu_text<span class="Delimiter">(</span>out<span class="Delimiter">.</span>str<span class="Delimiter">());</span> <span class="Delimiter">}</span> <span class="Normal">int</span> trace_error_contents<span class="Delimiter">()</span> <span class="Delimiter">{</span> @@ -460,7 +460,7 @@ string strip_comments<span class="Delimiter">(</span>string in<span class="Delim string result = out<span class="Delimiter">.</span>str<span class="Delimiter">();</span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> truncate<span class="Delimiter">(</span>result<span class="Delimiter">);</span> - <span class="Identifier">return</span> new_mu_string<span class="Delimiter">(</span>result<span class="Delimiter">);</span> + <span class="Identifier">return</span> new_mu_text<span class="Delimiter">(</span>result<span class="Delimiter">);</span> <span class="Delimiter">}</span> <span class="Normal">int</span> trace_app_contents<span class="Delimiter">()</span> <span class="Delimiter">{</span> @@ -474,7 +474,7 @@ string strip_comments<span class="Delimiter">(</span>string in<span class="Delim string result = out<span class="Delimiter">.</span>str<span class="Delimiter">();</span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span> truncate<span class="Delimiter">(</span>result<span class="Delimiter">);</span> - <span class="Identifier">return</span> new_mu_string<span class="Delimiter">(</span>result<span class="Delimiter">);</span> + <span class="Identifier">return</span> new_mu_text<span class="Delimiter">(</span>result<span class="Delimiter">);</span> <span class="Delimiter">}</span> <span class="Normal">void</span> truncate<span class="Delimiter">(</span>string& x<span class="Delimiter">)</span> <span class="Delimiter">{</span> @@ -499,7 +499,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span raise << maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'reload' requires exactly one ingredient, but got '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_string<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> raise << maybe<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"first ingredient of 'reload' should be a string, but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -518,7 +518,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span Recipe_variants = Recipe_variants_snapshot<span class="Delimiter">;</span> Name = Name_snapshot<span class="Delimiter">;</span> <span class="Comment">// }</span> - string code = read_mu_string<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> + string code = read_mu_text<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> run_code_begin<span class="Delimiter">(</span><span class="Comment">/*</span><span class="Comment">should_stash_snapshots</span><span class="Comment">*/</span><span class="Constant">false</span><span class="Delimiter">);</span> routine* save_current_routine = Current_routine<span class="Delimiter">;</span> Current_routine = <span class="Constant">NULL</span><span class="Delimiter">;</span> @@ -537,11 +537,11 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">:(scenario reload_continues_past_error)</span> def main [ local-scope - <span class="Normal">x</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [recipe foo [ - get <span class="Constant">1234</span>:number<span class="Delimiter">,</span> foo:offset + <span class="Normal">x</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [recipe foo [ + get <span class="Constant">1234</span>:num<span class="Delimiter">,</span> foo:offset ]] reload x - <span class="Constant">1</span>:number/<span class="Special">raw <- </span>copy <span class="Constant">34</span> + <span class="Constant">1</span>:num/<span class="Special">raw <- </span>copy <span class="Constant">34</span> ] <span class="traceContains">+mem: storing 34 in location 1</span> @@ -549,10 +549,10 @@ def main [ <span class="Comment"># define a container and try to create it (merge requires knowing container size)</span> def main [ local-scope - <span class="Normal">x</span>:address:array:character<span class="Special"> <- </span><span class="Normal">new</span> [ + <span class="Normal">x</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [ container foo [ - <span class="Normal">x</span>:number - <span class="Normal">y</span>:number + <span class="Normal">x</span>:num + <span class="Normal">y</span>:num ] recipe bar [ local-scope @@ -560,8 +560,8 @@ def main [ ] ] <span class="Comment"># save warning addresses in locations of type 'number' to avoid spurious changes to them due to 'abandon'</span> - <span class="Constant">1</span>:number/<span class="Special">raw <- </span>reload x - <span class="Constant">2</span>:number/<span class="Special">raw <- </span>reload x + <span class="Constant">1</span>:num/<span class="Special">raw <- </span>reload x + <span class="Constant">2</span>:num/<span class="Special">raw <- </span>reload x ] <span class="Comment"># no errors on either load</span> <span class="traceContains">+mem: storing 0 in location 1</span> |