diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-12-26 20:44:10 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-12-26 20:58:37 -0800 |
commit | 201458e3bd2f1d79a0ea0b853552e9df267e92b1 (patch) | |
tree | 0a4f13662cde7f92ae0bcf641c9733e2a0fcd6ef /html/050scenario.cc.html | |
parent | e35c2d6857e1ed916221faae707e3c53ff8ed042 (diff) | |
download | mu-201458e3bd2f1d79a0ea0b853552e9df267e92b1.tar.gz |
3713 - cross-link calls with definitions in html
Diffstat (limited to 'html/050scenario.cc.html')
-rw-r--r-- | html/050scenario.cc.html | 312 |
1 files changed, 156 insertions, 156 deletions
diff --git a/html/050scenario.cc.html b/html/050scenario.cc.html index eefb97bc..71157ba9 100644 --- a/html/050scenario.cc.html +++ b/html/050scenario.cc.html @@ -68,7 +68,7 @@ if ('onhashchange' in window) { <span id="L5" class="LineNr"> 5 </span><span class="Comment">//: handy to check the values of specific variables</span> <span id="L6" class="LineNr"> 6 </span><span class="Delimiter">:(scenarios run_mu_scenario)</span> <span id="L7" class="LineNr"> 7 </span><span class="Delimiter">:(scenario scenario_block)</span> -<span id="L8" class="LineNr"> 8 </span><span class="muScenario">scenario</span> foo [ +<span id="L8" class="LineNr"> 8 </span><span class="muScenario"><a href='050scenario.cc.html#L57'>scenario</a></span> foo [ <span id="L9" class="LineNr"> 9 </span> run [ <span id="L10" class="LineNr"> 10 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">13</span> <span id="L11" class="LineNr"> 11 </span> ] @@ -79,7 +79,7 @@ if ('onhashchange' in window) { <span id="L16" class="LineNr"> 16 </span><span class="Comment"># checks are inside scenario</span> <span id="L17" class="LineNr"> 17 </span> <span id="L18" class="LineNr"> 18 </span><span class="Delimiter">:(scenario scenario_multiple_blocks)</span> -<span id="L19" class="LineNr"> 19 </span><span class="muScenario">scenario</span> foo [ +<span id="L19" class="LineNr"> 19 </span><span class="muScenario"><a href='050scenario.cc.html#L57'>scenario</a></span> foo [ <span id="L20" class="LineNr"> 20 </span> run [ <span id="L21" class="LineNr"> 21 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">13</span> <span id="L22" class="LineNr"> 22 </span> ] @@ -97,10 +97,10 @@ if ('onhashchange' in window) { <span id="L34" class="LineNr"> 34 </span><span class="Comment"># checks are inside scenario</span> <span id="L35" class="LineNr"> 35 </span> <span id="L36" class="LineNr"> 36 </span><span class="Delimiter">:(scenario scenario_check_memory_and_trace)</span> -<span id="L37" class="LineNr"> 37 </span><span class="muScenario">scenario</span> foo [ +<span id="L37" class="LineNr"> 37 </span><span class="muScenario"><a href='050scenario.cc.html#L57'>scenario</a></span> foo [ <span id="L38" class="LineNr"> 38 </span> run [ <span id="L39" class="LineNr"> 39 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">13</span> -<span id="L40" class="LineNr"> 40 </span> trace <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [a b c] +<span id="L40" class="LineNr"> 40 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [a b c] <span id="L41" class="LineNr"> 41 </span> ] <span id="L42" class="LineNr"> 42 </span> memory-should-contain [ <span id="L43" class="LineNr"> 43 </span> <span class="Constant">1</span><span class="Special"> <- </span><span class="Constant">13</span> @@ -117,12 +117,12 @@ if ('onhashchange' in window) { <span id="L54" class="LineNr"> 54 </span><span class="SalientComment">//:: Core data structure</span> <span id="L55" class="LineNr"> 55 </span> <span id="L56" class="LineNr"> 56 </span><span class="Delimiter">:(before "End Types")</span> -<span id="L57" class="LineNr"> 57 </span><span class="Normal">struct</span> scenario <span class="Delimiter">{</span> +<span id="L57" class="LineNr"> 57 </span><span class="Normal">struct</span> <a href='050scenario.cc.html#L57'>scenario</a> <span class="Delimiter">{</span> <span id="L58" class="LineNr"> 58 </span> string name<span class="Delimiter">;</span> <span id="L59" class="LineNr"> 59 </span> string to_run<span class="Delimiter">;</span> -<span id="L60" class="LineNr"> 60 </span> <span class="Normal">void</span> clear<span class="Delimiter">()</span> <span class="Delimiter">{</span> -<span id="L61" class="LineNr"> 61 </span> name<span class="Delimiter">.</span>clear<span class="Delimiter">();</span> -<span id="L62" class="LineNr"> 62 </span> to_run<span class="Delimiter">.</span>clear<span class="Delimiter">();</span> +<span id="L60" class="LineNr"> 60 </span> <span class="Normal">void</span> <a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> +<span id="L61" class="LineNr"> 61 </span> name<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> +<span id="L62" class="LineNr"> 62 </span> to_run<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L63" class="LineNr"> 63 </span> <span class="Delimiter">}</span> <span id="L64" class="LineNr"> 64 </span><span class="Delimiter">};</span> <span id="L65" class="LineNr"> 65 </span> @@ -134,57 +134,57 @@ if ('onhashchange' in window) { <span id="L71" class="LineNr"> 71 </span> <span id="L72" class="LineNr"> 72 </span><span class="Delimiter">:(before "End Command Handlers")</span> <span id="L73" class="LineNr"> 73 </span><span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>command == <span class="Constant">"scenario"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L74" class="LineNr"> 74 </span> scenario result = parse_scenario<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L74" class="LineNr"> 74 </span> <a href='050scenario.cc.html#L57'>scenario</a> result = <a href='050scenario.cc.html#L84'>parse_scenario</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L75" class="LineNr"> 75 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!result<span class="Delimiter">.</span>name<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span id="L76" class="LineNr"> 76 </span> Scenarios<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>result<span class="Delimiter">);</span> <span id="L77" class="LineNr"> 77 </span><span class="Delimiter">}</span> <span id="L78" class="LineNr"> 78 </span><span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>command == <span class="Constant">"pending-scenario"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L79" class="LineNr"> 79 </span> <span class="Comment">// for temporary use only</span> -<span id="L80" class="LineNr"> 80 </span> parse_scenario<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span class="Comment">// discard</span> +<span id="L80" class="LineNr"> 80 </span> <a href='050scenario.cc.html#L84'>parse_scenario</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span class="Comment">// discard</span> <span id="L81" class="LineNr"> 81 </span><span class="Delimiter">}</span> <span id="L82" class="LineNr"> 82 </span> <span id="L83" class="LineNr"> 83 </span><span class="Delimiter">:(code)</span> -<span id="L84" class="LineNr"> 84 </span><span class="muScenario">scenario</span> parse_scenario<span class="Delimiter">(</span>istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L85" class="LineNr"> 85 </span> scenario result<span class="Delimiter">;</span> -<span id="L86" class="LineNr"> 86 </span> result<span class="Delimiter">.</span>name = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L84" class="LineNr"> 84 </span><span class="muScenario"><a href='050scenario.cc.html#L57'>scenario</a></span> <a href='050scenario.cc.html#L84'>parse_scenario</a><span class="Delimiter">(</span>istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L85" class="LineNr"> 85 </span> <a href='050scenario.cc.html#L57'>scenario</a> result<span class="Delimiter">;</span> +<span id="L86" class="LineNr"> 86 </span> result<span class="Delimiter">.</span>name = <a href='011load.cc.html#L166'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L87" class="LineNr"> 87 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">.</span>name<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L88" class="LineNr"> 88 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L89" class="LineNr"> 89 </span> raise << <span class="Constant">"incomplete scenario at end of file</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L89" class="LineNr"> 89 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete <a href='050scenario.cc.html#L57'>scenario</a> at <a href='003trace.cc.html#L195'>end</a> of file</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L90" class="LineNr"> 90 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L91" class="LineNr"> 91 </span> <span class="Delimiter">}</span> -<span id="L92" class="LineNr"> 92 </span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L92" class="LineNr"> 92 </span> <a href='011load.cc.html#L208'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L93" class="LineNr"> 93 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="Constant">'['</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L94" class="LineNr"> 94 </span> raise << <span class="Constant">"Expected '[' after scenario '"</span> << result<span class="Delimiter">.</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L94" class="LineNr"> 94 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"Expected '[' after <a href='050scenario.cc.html#L57'>scenario</a> '"</span> << result<span class="Delimiter">.</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L95" class="LineNr"> 95 </span> exit<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L96" class="LineNr"> 96 </span> <span class="Delimiter">}</span> <span id="L97" class="LineNr"> 97 </span> <span class="Comment">// scenarios are take special 'code' strings so we need to ignore brackets</span> <span id="L98" class="LineNr"> 98 </span> <span class="Comment">// inside comments</span> -<span id="L99" class="LineNr"> 99 </span> result<span class="Delimiter">.</span>to_run = slurp_quoted<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L99" class="LineNr"> 99 </span> result<span class="Delimiter">.</span>to_run = <a href='014literal_string.cc.html#L33'>slurp_quoted</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L100" class="LineNr">100 </span> <span class="Comment">// delete [] delimiters</span> <span id="L101" class="LineNr">101 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!starts_with<span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">,</span> <span class="Constant">"["</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L102" class="LineNr">102 </span> raise << <span class="Constant">"scenario "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" should start with '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> -<span id="L103" class="LineNr">103 </span> result<span class="Delimiter">.</span>clear<span class="Delimiter">();</span> +<span id="L102" class="LineNr">102 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"scenario "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" should start with '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L103" class="LineNr">103 </span> result<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L104" class="LineNr">104 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L105" class="LineNr">105 </span> <span class="Delimiter">}</span> <span id="L106" class="LineNr">106 </span> result<span class="Delimiter">.</span>to_run<span class="Delimiter">.</span>erase<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">);</span> -<span id="L107" class="LineNr">107 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">.</span>at<span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">)</span>-<span class="Constant">1</span><span class="Delimiter">)</span> != <span class="Constant">']'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L108" class="LineNr">108 </span> raise << <span class="Constant">"scenario "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" has an unbalanced '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> -<span id="L109" class="LineNr">109 </span> result<span class="Delimiter">.</span>clear<span class="Delimiter">();</span> +<span id="L107" class="LineNr">107 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">.</span>at<span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">)</span>-<span class="Constant">1</span><span class="Delimiter">)</span> != <span class="Constant">']'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L108" class="LineNr">108 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"scenario "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" has an unbalanced '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L109" class="LineNr">109 </span> result<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L110" class="LineNr">110 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L111" class="LineNr">111 </span> <span class="Delimiter">}</span> -<span id="L112" class="LineNr">112 </span> result<span class="Delimiter">.</span>to_run<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">)</span>-<span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L112" class="LineNr">112 </span> result<span class="Delimiter">.</span>to_run<span class="Delimiter">.</span>erase<span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>result<span class="Delimiter">.</span>to_run<span class="Delimiter">)</span>-<span class="Constant">1</span><span class="Delimiter">);</span> <span id="L113" class="LineNr">113 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L114" class="LineNr">114 </span><span class="Delimiter">}</span> <span id="L115" class="LineNr">115 </span> <span id="L116" class="LineNr">116 </span><span class="Delimiter">:(scenario read_scenario_with_bracket_in_comment)</span> -<span id="L117" class="LineNr">117 </span><span class="muScenario">scenario</span> foo [ +<span id="L117" class="LineNr">117 </span><span class="muScenario"><a href='050scenario.cc.html#L57'>scenario</a></span> foo [ <span id="L118" class="LineNr">118 </span> <span class="Comment"># ']' in comment</span> <span id="L119" class="LineNr">119 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">0</span> <span id="L120" class="LineNr">120 </span>] <span id="L121" class="LineNr">121 </span><span class="traceContains">+run: {1: "number"} <- copy {0: "literal"}</span> <span id="L122" class="LineNr">122 </span> <span id="L123" class="LineNr">123 </span><span class="Delimiter">:(scenario read_scenario_with_bracket_in_comment_in_nested_string)</span> -<span id="L124" class="LineNr">124 </span><span class="muScenario">scenario</span> foo [ +<span id="L124" class="LineNr">124 </span><span class="muScenario"><a href='050scenario.cc.html#L57'>scenario</a></span> foo [ <span id="L125" class="LineNr">125 </span> <span class="Constant">1</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [<span class="Comment"># not a comment]</span> <span id="L126" class="LineNr">126 </span>] <span id="L127" class="LineNr">127 </span><span class="traceContains">+run: {1: ("address" "array" "character")} <- new {"# not a comment": "literal-string"}</span> @@ -195,7 +195,7 @@ if ('onhashchange' in window) { <span id="L132" class="LineNr">132 </span><span class="Delimiter">:(before "End Globals")</span> <span id="L133" class="LineNr">133 </span><span class="Normal">int</span> Num_core_mu_scenarios = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L134" class="LineNr">134 </span><span class="Delimiter">:(after "Check For .mu Files")</span> -<span id="L135" class="LineNr">135 </span>Num_core_mu_scenarios = SIZE<span class="Delimiter">(</span>Scenarios<span class="Delimiter">);</span> +<span id="L135" class="LineNr">135 </span>Num_core_mu_scenarios = <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>Scenarios<span class="Delimiter">);</span> <span id="L136" class="LineNr">136 </span><span class="Delimiter">:(before "End Tests")</span> <span id="L137" class="LineNr">137 </span>Hide_missing_default_space_errors = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L138" class="LineNr">138 </span><span class="Normal">if</span> <span class="Delimiter">(</span>Num_core_mu_scenarios > <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> @@ -210,10 +210,10 @@ if ('onhashchange' in window) { <span id="L147" class="LineNr">147 </span> cerr << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">;</span> <span id="L148" class="LineNr">148 </span><span class="Delimiter">}</span> <span id="L149" class="LineNr">149 </span><span class="Normal">run_app_scenarios</span>: -<span id="L150" class="LineNr">150 </span><span class="Normal">if</span> <span class="Delimiter">(</span>Num_core_mu_scenarios != SIZE<span class="Delimiter">(</span>Scenarios<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L150" class="LineNr">150 </span><span class="Normal">if</span> <span class="Delimiter">(</span>Num_core_mu_scenarios != <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>Scenarios<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L151" class="LineNr">151 </span> time<span class="Delimiter">(</span>&t<span class="Delimiter">);</span> <span id="L152" class="LineNr">152 </span> cerr << <span class="Constant">"App tests: "</span> << ctime<span class="Delimiter">(</span>&t<span class="Delimiter">);</span> -<span id="L153" class="LineNr">153 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = Num_core_mu_scenarios<span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>Scenarios<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L153" class="LineNr">153 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = Num_core_mu_scenarios<span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>Scenarios<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L154" class="LineNr">154 </span><span class="CommentedCode">//? cerr << '\n' << i << ": " << Scenarios.at(i).name;</span> <span id="L155" class="LineNr">155 </span> run_mu_scenario<span class="Delimiter">(</span>Scenarios<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> <span id="L156" class="LineNr">156 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Passed<span class="Delimiter">)</span> cerr << <span class="Constant">"."</span><span class="Delimiter">;</span> @@ -227,17 +227,17 @@ if ('onhashchange' in window) { <span id="L164" class="LineNr">164 </span><span class="Delimiter">:(before "End Globals")</span> <span id="L165" class="LineNr">165 </span><span class="Normal">bool</span> Test_only_app = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L166" class="LineNr">166 </span><span class="Delimiter">:(before "End Commandline Options(*arg)")</span> -<span id="L167" class="LineNr">167 </span><span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_equal<span class="Delimiter">(</span>*arg<span class="Delimiter">,</span> <span class="Constant">"--test-only-app"</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L167" class="LineNr">167 </span><span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L70'>is_equal</a><span class="Delimiter">(</span>*arg<span class="Delimiter">,</span> <span class="Constant">"--test-only-app"</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L168" class="LineNr">168 </span> Test_only_app = <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L169" class="LineNr">169 </span><span class="Delimiter">}</span> <span id="L170" class="LineNr">170 </span><span class="Delimiter">:(after "End Test Run Initialization")</span> -<span id="L171" class="LineNr">171 </span><span class="Normal">if</span> <span class="Delimiter">(</span>Test_only_app && Num_core_mu_scenarios < SIZE<span class="Delimiter">(</span>Scenarios<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L171" class="LineNr">171 </span><span class="Normal">if</span> <span class="Delimiter">(</span>Test_only_app && Num_core_mu_scenarios < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>Scenarios<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L172" class="LineNr">172 </span> <span class="Identifier">goto</span> run_app_scenarios<span class="Delimiter">;</span> <span id="L173" class="LineNr">173 </span><span class="Delimiter">}</span> <span id="L174" class="LineNr">174 </span> <span id="L175" class="LineNr">175 </span><span class="Comment">//: Convenience: run a single named scenario.</span> <span id="L176" class="LineNr">176 </span><span class="Delimiter">:(after "Test Runs")</span> -<span id="L177" class="LineNr">177 </span><span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>Scenarios<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L177" class="LineNr">177 </span><span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>Scenarios<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L178" class="LineNr">178 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Scenarios<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name == argv[argc-<span class="Constant">1</span>]<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L179" class="LineNr">179 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Start_tracing<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L180" class="LineNr">180 </span> Trace_stream = <span class="Normal">new</span> trace_stream<span class="Delimiter">;</span> @@ -259,22 +259,22 @@ if ('onhashchange' in window) { <span id="L196" class="LineNr">196 </span><span class="CommentedCode">//? cerr << s.name << '\n';</span> <span id="L197" class="LineNr">197 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>not_already_inside_test<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L198" class="LineNr">198 </span> Trace_stream = <span class="Normal">new</span> trace_stream<span class="Delimiter">;</span> -<span id="L199" class="LineNr">199 </span> setup<span class="Delimiter">();</span> +<span id="L199" class="LineNr">199 </span> <a href='000organization.cc.html#L134'>setup</a><span class="Delimiter">();</span> <span id="L200" class="LineNr">200 </span> <span class="Delimiter">}</span> <span id="L201" class="LineNr">201 </span> vector<recipe_ordinal> tmp = load<span class="Delimiter">(</span><span class="Constant">"recipe scenario_"</span>+s<span class="Delimiter">.</span>name+<span class="Constant">" [ "</span>+s<span class="Delimiter">.</span>to_run+<span class="Constant">" ]"</span><span class="Delimiter">);</span> <span id="L202" class="LineNr">202 </span> mark_autogenerated<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> <span id="L203" class="LineNr">203 </span> bind_special_scenario_names<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> -<span id="L204" class="LineNr">204 </span> transform_all<span class="Delimiter">();</span> +<span id="L204" class="LineNr">204 </span> <a href='012transform.cc.html#L46'>transform_all</a><span class="Delimiter">();</span> <span id="L205" class="LineNr">205 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!trace_contains_errors<span class="Delimiter">())</span> <span id="L206" class="LineNr">206 </span> run<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>front<span class="Delimiter">());</span> <span id="L207" class="LineNr">207 </span> <span class="Comment">// End Mu Test Teardown</span> -<span id="L208" class="LineNr">208 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Hide_errors && trace_contains_errors<span class="Delimiter">()</span> && !Scenario_testing_scenario<span class="Delimiter">)</span> +<span id="L208" class="LineNr">208 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Hide_errors && <a href='003trace.cc.html#L190'>trace_contains_errors</a><span class="Delimiter">()</span> && !Scenario_testing_scenario<span class="Delimiter">)</span> <span id="L209" class="LineNr">209 </span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L210" class="LineNr">210 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>not_already_inside_test && Trace_stream<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L211" class="LineNr">211 </span> teardown<span class="Delimiter">();</span> +<span id="L211" class="LineNr">211 </span> <a href='000organization.cc.html#L138'>teardown</a><span class="Delimiter">();</span> <span id="L212" class="LineNr">212 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Save_trace<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L213" class="LineNr">213 </span> ofstream fout<span class="Delimiter">(</span><span class="Constant">"last_trace"</span><span class="Delimiter">);</span> -<span id="L214" class="LineNr">214 </span> fout << Trace_stream<span class="Delimiter">-></span>readable_contents<span class="Delimiter">(</span><span class="Constant">""</span><span class="Delimiter">);</span> +<span id="L214" class="LineNr">214 </span> fout << Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L153'>readable_contents</a><span class="Delimiter">(</span><span class="Constant">""</span><span class="Delimiter">);</span> <span id="L215" class="LineNr">215 </span> fout<span class="Delimiter">.</span>close<span class="Delimiter">();</span> <span id="L216" class="LineNr">216 </span> <span class="Delimiter">}</span> <span id="L217" class="LineNr">217 </span> <span class="Normal">delete</span> Trace_stream<span class="Delimiter">;</span> @@ -293,7 +293,7 @@ if ('onhashchange' in window) { <span id="L230" class="LineNr">230 </span> <span id="L231" class="LineNr">231 </span><span class="Delimiter">:(code)</span> <span id="L232" class="LineNr">232 </span><span class="Comment">// Should contain everything passed by is_special_name but failed by is_disqualified.</span> -<span id="L233" class="LineNr">233 </span><span class="Normal">void</span> bind_special_scenario_names<span class="Delimiter">(</span><span class="Normal">const</span> recipe_ordinal r<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L233" class="LineNr">233 </span><span class="Normal">void</span> bind_special_scenario_names<span class="Delimiter">(</span><span class="Normal">const</span> <a href='010vm.cc.html#L14'>recipe_ordinal</a> r<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L234" class="LineNr">234 </span> <span class="Comment">// Special Scenario Variable Names(r)</span> <span id="L235" class="LineNr">235 </span> <span class="Comment">// End Special Scenario Variable Names(r)</span> <span id="L236" class="LineNr">236 </span><span class="Delimiter">}</span> @@ -304,13 +304,13 @@ if ('onhashchange' in window) { <span id="L241" class="LineNr">241 </span><span class="Delimiter">:(code)</span> <span id="L242" class="LineNr">242 </span><span class="Normal">void</span> maybe_make_raw<span class="Delimiter">(</span>reagent& r<span class="Delimiter">,</span> <span class="Normal">const</span> recipe& caller<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L243" class="LineNr">243 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_special_name<span class="Delimiter">(</span>r<span class="Delimiter">.</span>name<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> -<span id="L244" class="LineNr">244 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>starts_with<span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">,</span> <span class="Constant">"scenario_"</span><span class="Delimiter">))</span> +<span id="L244" class="LineNr">244 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L74'>starts_with</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">,</span> <span class="Constant">"scenario_"</span><span class="Delimiter">))</span> <span id="L245" class="LineNr">245 </span> r<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>pair<string<span class="Delimiter">,</span> string_tree*><span class="Delimiter">(</span><span class="Constant">"raw"</span><span class="Delimiter">,</span> <span class="Constant">NULL</span><span class="Delimiter">));</span> <span id="L246" class="LineNr">246 </span> <span class="Comment">// End maybe_make_raw</span> <span id="L247" class="LineNr">247 </span><span class="Delimiter">}</span> <span id="L248" class="LineNr">248 </span> <span id="L249" class="LineNr">249 </span><span class="Comment">//: Test.</span> -<span id="L250" class="LineNr">250 </span><span class="Delimiter">:(before "End is_special_name Special-cases")</span> +<span id="L250" class="LineNr">250 </span><span class="Delimiter">:(before "End <a href='042name.cc.html#L156'>is_special_name</a> Special-cases")</span> <span id="L251" class="LineNr">251 </span><span class="Normal">if</span> <span class="Delimiter">(</span>s == <span class="Constant">"__maybe_make_raw_test__"</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L252" class="LineNr">252 </span><span class="Delimiter">:(before "End Special Scenario Variable Names(r)")</span> <span id="L253" class="LineNr">253 </span><span class="Comment">//: ugly: we only need this for this one test, but need to define it for all time</span> @@ -325,9 +325,9 @@ if ('onhashchange' in window) { <span id="L262" class="LineNr">262 </span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> <span id="L263" class="LineNr">263 </span> mark_autogenerated<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> <span id="L264" class="LineNr">264 </span> bind_special_scenario_names<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> -<span id="L265" class="LineNr">265 </span> transform_all<span class="Delimiter">();</span> +<span id="L265" class="LineNr">265 </span> <a href='012transform.cc.html#L46'>transform_all</a><span class="Delimiter">();</span> <span id="L266" class="LineNr">266 </span> run<span class="Delimiter">(</span>tmp<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> -<span id="L267" class="LineNr">267 </span> CHECK_TRACE_DOESNT_CONTAIN_ERRORS<span class="Delimiter">();</span> +<span id="L267" class="LineNr">267 </span> <a href='003trace.cc.html#L231'>CHECK_TRACE_DOESNT_CONTAIN_ERRORS</a><span class="Delimiter">();</span> <span id="L268" class="LineNr">268 </span><span class="Delimiter">}</span> <span id="L269" class="LineNr">269 </span> <span id="L270" class="LineNr">270 </span><span class="Comment">//: Watch out for redefinitions of scenario routines. We should never ever be</span> @@ -342,11 +342,11 @@ if ('onhashchange' in window) { <span id="L279" class="LineNr">279 </span><span class="muRecipe">def</span> scenario-foo [ <span id="L280" class="LineNr">280 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">35</span> <span id="L281" class="LineNr">281 </span>] -<span id="L282" class="LineNr">282 </span><span class="traceContains">+error: redefining recipe scenario-foo</span> +<span id="L282" class="LineNr">282 </span><span class="traceContains">+error: redefining <a href='010vm.cc.html#L19'>recipe</a> scenario-foo</span> <span id="L283" class="LineNr">283 </span> <span id="L284" class="LineNr">284 </span><span class="Delimiter">:(scenario scenario_containing_parse_error)</span> <span id="L285" class="LineNr">285 </span><span class="Special">% Hide_errors = true;</span> -<span id="L286" class="LineNr">286 </span><span class="muScenario">scenario</span> foo [ +<span id="L286" class="LineNr">286 </span><span class="muScenario"><a href='050scenario.cc.html#L57'>scenario</a></span> foo [ <span id="L287" class="LineNr">287 </span> memory-should-contain [ <span id="L288" class="LineNr">288 </span> <span class="Constant">1</span><span class="Special"> <- </span><span class="Constant">0</span> <span id="L289" class="LineNr">289 </span> <span class="Comment"># missing ']'</span> @@ -355,7 +355,7 @@ if ('onhashchange' in window) { <span id="L292" class="LineNr">292 </span> <span id="L293" class="LineNr">293 </span><span class="Delimiter">:(scenario scenario_containing_transform_error)</span> <span id="L294" class="LineNr">294 </span><span class="Special">% Hide_errors = true;</span> -<span id="L295" class="LineNr">295 </span><span class="muRecipe">def</span> main [ +<span id="L295" class="LineNr">295 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L296" class="LineNr">296 </span> local-scope <span id="L297" class="LineNr">297 </span> add x<span class="Delimiter">,</span> <span class="Constant">1</span> <span id="L298" class="LineNr">298 </span>] @@ -372,24 +372,24 @@ if ('onhashchange' in window) { <span id="L309" class="LineNr">309 </span><span class="Comment">//: tested from any setup or teardown</span> <span id="L310" class="LineNr">310 </span> <span id="L311" class="LineNr">311 </span><span class="Delimiter">:(scenario run)</span> -<span id="L312" class="LineNr">312 </span><span class="muRecipe">def</span> main [ +<span id="L312" class="LineNr">312 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L313" class="LineNr">313 </span> run [ <span id="L314" class="LineNr">314 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">13</span> <span id="L315" class="LineNr">315 </span> ] <span id="L316" class="LineNr">316 </span>] <span id="L317" class="LineNr">317 </span><span class="traceContains">+mem: storing 13 in location 1</span> <span id="L318" class="LineNr">318 </span> -<span id="L319" class="LineNr">319 </span><span class="Delimiter">:(before "End Rewrite Instruction(curr, recipe result)")</span> +<span id="L319" class="LineNr">319 </span><span class="Delimiter">:(before "End Rewrite Instruction(curr, <a href='010vm.cc.html#L19'>recipe</a> result)")</span> <span id="L320" class="LineNr">320 </span><span class="Normal">if</span> <span class="Delimiter">(</span>curr<span class="Delimiter">.</span>name == <span class="Constant">"run"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L321" class="LineNr">321 </span> <span class="Comment">// Just inline all instructions inside the run block in the containing</span> <span id="L322" class="LineNr">322 </span> <span class="Comment">// recipe. 'run' is basically a comment; pretend it doesn't exist.</span> <span id="L323" class="LineNr">323 </span> istringstream in2<span class="Delimiter">(</span><span class="Constant">"[</span><span class="cSpecial">\n</span><span class="Constant">"</span>+curr<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name+<span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">]</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> -<span id="L324" class="LineNr">324 </span> slurp_body<span class="Delimiter">(</span>in2<span class="Delimiter">,</span> result<span class="Delimiter">);</span> -<span id="L325" class="LineNr">325 </span> curr<span class="Delimiter">.</span>clear<span class="Delimiter">();</span> +<span id="L324" class="LineNr">324 </span> <a href='011load.cc.html#L81'>slurp_body</a><span class="Delimiter">(</span>in2<span class="Delimiter">,</span> result<span class="Delimiter">);</span> +<span id="L325" class="LineNr">325 </span> curr<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L326" class="LineNr">326 </span><span class="Delimiter">}</span> <span id="L327" class="LineNr">327 </span> <span id="L328" class="LineNr">328 </span><span class="Delimiter">:(scenario run_multiple)</span> -<span id="L329" class="LineNr">329 </span><span class="muRecipe">def</span> main [ +<span id="L329" class="LineNr">329 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L330" class="LineNr">330 </span> run [ <span id="L331" class="LineNr">331 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">13</span> <span id="L332" class="LineNr">332 </span> ] @@ -411,7 +411,7 @@ if ('onhashchange' in window) { <span id="L348" class="LineNr">348 </span><span class="Delimiter">:(scenario memory_check)</span> <span id="L349" class="LineNr">349 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L350" class="LineNr">350 </span><span class="Special">% Hide_errors = true;</span> -<span id="L351" class="LineNr">351 </span><span class="muRecipe">def</span> main [ +<span id="L351" class="LineNr">351 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L352" class="LineNr">352 </span> memory-should-contain [ <span id="L353" class="LineNr">353 </span> <span class="Constant">1</span><span class="Special"> <- </span><span class="Constant">13</span> <span id="L354" class="LineNr">354 </span> ] @@ -422,7 +422,7 @@ if ('onhashchange' in window) { <span id="L359" class="LineNr">359 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L360" class="LineNr">360 </span>MEMORY_SHOULD_CONTAIN<span class="Delimiter">,</span> <span id="L361" class="LineNr">361 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L362" class="LineNr">362 </span>put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"memory-should-contain"</span><span class="Delimiter">,</span> MEMORY_SHOULD_CONTAIN<span class="Delimiter">);</span> +<span id="L362" class="LineNr">362 </span><a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"memory-should-contain"</span><span class="Delimiter">,</span> MEMORY_SHOULD_CONTAIN<span class="Delimiter">);</span> <span id="L363" class="LineNr">363 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L364" class="LineNr">364 </span><span class="Normal">case</span> MEMORY_SHOULD_CONTAIN: <span class="Delimiter">{</span> <span id="L365" class="LineNr">365 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -440,109 +440,109 @@ if ('onhashchange' in window) { <span id="L377" class="LineNr">377 </span> in >> std::noskipws<span class="Delimiter">;</span> <span id="L378" class="LineNr">378 </span> set<<span class="Normal">int</span>> locations_checked<span class="Delimiter">;</span> <span id="L379" class="LineNr">379 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><span class="Constant">true</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L380" class="LineNr">380 </span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L380" class="LineNr">380 </span> <a href='011load.cc.html#L208'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L381" class="LineNr">381 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Identifier">break</span><span class="Delimiter">;</span> -<span id="L382" class="LineNr">382 </span> string lhs = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L382" class="LineNr">382 </span> string lhs = <a href='011load.cc.html#L166'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L383" class="LineNr">383 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>lhs<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L384" class="LineNr">384 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L385" class="LineNr">385 </span> raise << <span class="Constant">"incomplete 'memory-should-contain' block at end of file (0)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L385" class="LineNr">385 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L195'>end</a> of file (0)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L386" class="LineNr">386 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L387" class="LineNr">387 </span> <span class="Delimiter">}</span> <span id="L388" class="LineNr">388 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_integer<span class="Delimiter">(</span>lhs<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L389" class="LineNr">389 </span> check_type<span class="Delimiter">(</span>lhs<span class="Delimiter">,</span> in<span class="Delimiter">);</span> +<span id="L389" class="LineNr">389 </span> <a href='047check_type_by_name.cc.html#L49'>check_type</a><span class="Delimiter">(</span>lhs<span class="Delimiter">,</span> in<span class="Delimiter">);</span> <span id="L390" class="LineNr">390 </span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L391" class="LineNr">391 </span> <span class="Delimiter">}</span> -<span id="L392" class="LineNr">392 </span> <span class="Normal">int</span> address = to_integer<span class="Delimiter">(</span>lhs<span class="Delimiter">);</span> -<span id="L393" class="LineNr">393 </span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L392" class="LineNr">392 </span> <span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a> = <a href='002test.cc.html#L92'>to_integer</a><span class="Delimiter">(</span>lhs<span class="Delimiter">);</span> +<span id="L393" class="LineNr">393 </span> <a href='011load.cc.html#L208'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L394" class="LineNr">394 </span> string _assign<span class="Delimiter">;</span> in >> _assign<span class="Delimiter">;</span> assert<span class="Delimiter">(</span>_assign == <span class="Constant">"<-"</span><span class="Delimiter">);</span> -<span id="L395" class="LineNr">395 </span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L396" class="LineNr">396 </span> string rhs = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L395" class="LineNr">395 </span> <a href='011load.cc.html#L208'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L396" class="LineNr">396 </span> string rhs = <a href='011load.cc.html#L166'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L397" class="LineNr">397 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>rhs<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L398" class="LineNr">398 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L399" class="LineNr">399 </span> raise << <span class="Constant">"incomplete 'memory-should-contain' block at end of file (1)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L399" class="LineNr">399 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L195'>end</a> of file (1)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L400" class="LineNr">400 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L401" class="LineNr">401 </span> <span class="Delimiter">}</span> <span id="L402" class="LineNr">402 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_integer<span class="Delimiter">(</span>rhs<span class="Delimiter">)</span> && !is_noninteger<span class="Delimiter">(</span>rhs<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L403" class="LineNr">403 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> <span id="L404" class="LineNr">404 </span> <span class="Comment">// genuine test in a .mu file</span> -<span id="L405" class="LineNr">405 </span> raise << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": location '"</span> << address << <span class="Constant">"' can't contain non-number "</span> << rhs << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L405" class="LineNr">405 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": location '"</span> << address << <span class="Constant">"' can't contain non-number "</span> << rhs << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L406" class="LineNr">406 </span> <span class="Normal">else</span> <span id="L407" class="LineNr">407 </span> <span class="Comment">// just testing scenario support</span> -<span id="L408" class="LineNr">408 </span> raise << <span class="Constant">"location '"</span> << address << <span class="Constant">"' can't contain non-number "</span> << rhs << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L408" class="LineNr">408 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"location '"</span> << address << <span class="Constant">"' can't contain non-number "</span> << rhs << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> <span id="L409" class="LineNr">409 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L410" class="LineNr">410 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L411" class="LineNr">411 </span> <span class="Delimiter">}</span> -<span id="L412" class="LineNr">412 </span> <span class="Normal">double</span> value = to_double<span class="Delimiter">(</span>rhs<span class="Delimiter">);</span> -<span id="L413" class="LineNr">413 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>locations_checked<span class="Delimiter">,</span> address<span class="Delimiter">))</span> -<span id="L414" class="LineNr">414 </span> raise << <span class="Constant">"duplicate expectation for location '"</span> << address << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> -<span id="L415" class="LineNr">415 </span> trace<span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking location "</span> << address << end<span class="Delimiter">();</span> -<span id="L416" class="LineNr">416 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address<span class="Delimiter">)</span> != value<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L412" class="LineNr">412 </span> <span class="Normal">double</span> value = <a href='015literal_noninteger.cc.html#L26'>to_double</a><span class="Delimiter">(</span>rhs<span class="Delimiter">);</span> +<span id="L413" class="LineNr">413 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>locations_checked<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> +<span id="L414" class="LineNr">414 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"duplicate expectation for location '"</span> << address << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L415" class="LineNr">415 </span> <a href='003trace.cc.html#L171'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking location "</span> << <a href='043space.cc.html#L76'>address</a> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L416" class="LineNr">416 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">)</span> != value<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L417" class="LineNr">417 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L418" class="LineNr">418 </span> <span class="Comment">// genuine test in a .mu file</span> -<span id="L419" class="LineNr">419 </span> raise << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location '"</span> << address << <span class="Constant">"' to contain "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << 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="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L419" class="LineNr">419 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location '"</span> << address << <span class="Constant">"' to contain "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L420" class="LineNr">420 </span> <span class="Delimiter">}</span> <span id="L421" class="LineNr">421 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L422" class="LineNr">422 </span> <span class="Comment">// just testing scenario support</span> -<span id="L423" class="LineNr">423 </span> raise << <span class="Constant">"expected location '"</span> << address << <span class="Constant">"' to contain "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << 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="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L423" class="LineNr">423 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"expected location '"</span> << address << <span class="Constant">"' to contain "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L424" class="LineNr">424 </span> <span class="Delimiter">}</span> <span id="L425" class="LineNr">425 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L426" class="LineNr">426 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L427" class="LineNr">427 </span> <span class="Delimiter">}</span> -<span id="L428" class="LineNr">428 </span> locations_checked<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>address<span class="Delimiter">);</span> +<span id="L428" class="LineNr">428 </span> locations_checked<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">);</span> <span id="L429" class="LineNr">429 </span> <span class="Delimiter">}</span> <span id="L430" class="LineNr">430 </span><span class="Delimiter">}</span> <span id="L431" class="LineNr">431 </span> -<span id="L432" class="LineNr">432 </span><span class="Normal">void</span> check_type<span class="Delimiter">(</span><span class="Normal">const</span> string& lhs<span class="Delimiter">,</span> istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L432" class="LineNr">432 </span><span class="Normal">void</span> <a href='047check_type_by_name.cc.html#L49'>check_type</a><span class="Delimiter">(</span><span class="Normal">const</span> string& lhs<span class="Delimiter">,</span> istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L433" class="LineNr">433 </span> reagent x<span class="Delimiter">(</span>lhs<span class="Delimiter">);</span> -<span id="L434" class="LineNr">434 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_array<span class="Delimiter">(</span>x<span class="Delimiter">.</span>type<span class="Delimiter">)</span> && is_mu_character<span class="Delimiter">(</span>array_element<span class="Delimiter">(</span>x<span class="Delimiter">.</span>type<span class="Delimiter">)))</span> <span class="Delimiter">{</span> -<span id="L435" class="LineNr">435 </span> x<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>to_integer<span class="Delimiter">(</span>x<span class="Delimiter">.</span>name<span class="Delimiter">));</span> -<span id="L436" class="LineNr">436 </span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L437" class="LineNr">437 </span> string _assign = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L434" class="LineNr">434 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_mu_array<span class="Delimiter">(</span>x<span class="Delimiter">.</span>type<span class="Delimiter">)</span> && is_mu_character<span class="Delimiter">(</span><a href='032array.cc.html#L370'>array_element</a><span class="Delimiter">(</span>x<span class="Delimiter">.</span>type<span class="Delimiter">)))</span> <span class="Delimiter">{</span> +<span id="L435" class="LineNr">435 </span> x<span class="Delimiter">.</span><a href='010vm.cc.html#L66'>set_value</a><span class="Delimiter">(</span><a href='002test.cc.html#L92'>to_integer</a><span class="Delimiter">(</span>x<span class="Delimiter">.</span>name<span class="Delimiter">));</span> +<span id="L436" class="LineNr">436 </span> <a href='011load.cc.html#L208'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L437" class="LineNr">437 </span> string _assign = <a href='011load.cc.html#L166'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L438" class="LineNr">438 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>_assign<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L439" class="LineNr">439 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L440" class="LineNr">440 </span> raise << <span class="Constant">"incomplete 'memory-should-contain' block at end of file (2)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L440" class="LineNr">440 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L195'>end</a> of file (2)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L441" class="LineNr">441 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L442" class="LineNr">442 </span> <span class="Delimiter">}</span> <span id="L443" class="LineNr">443 </span> assert<span class="Delimiter">(</span>_assign == <span class="Constant">"<-"</span><span class="Delimiter">);</span> -<span id="L444" class="LineNr">444 </span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L445" class="LineNr">445 </span> string literal = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L444" class="LineNr">444 </span> <a href='011load.cc.html#L208'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L445" class="LineNr">445 </span> string literal = <a href='011load.cc.html#L166'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L446" class="LineNr">446 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>literal<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L447" class="LineNr">447 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L448" class="LineNr">448 </span> raise << <span class="Constant">"incomplete 'memory-should-contain' block at end of file (3)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L448" class="LineNr">448 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"incomplete 'memory-should-contain' block at <a href='003trace.cc.html#L195'>end</a> of file (3)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L449" class="LineNr">449 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L450" class="LineNr">450 </span> <span class="Delimiter">}</span> -<span id="L451" class="LineNr">451 </span> <span class="Normal">int</span> address = x<span class="Delimiter">.</span>value<span class="Delimiter">;</span> +<span id="L451" class="LineNr">451 </span> <span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a> = x<span class="Delimiter">.</span>value<span class="Delimiter">;</span> <span id="L452" class="LineNr">452 </span> <span class="Comment">// exclude quoting brackets</span> <span id="L453" class="LineNr">453 </span> assert<span class="Delimiter">(</span>*literal<span class="Delimiter">.</span>begin<span class="Delimiter">()</span> == <span class="Constant">'['</span><span class="Delimiter">);</span> literal<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>literal<span class="Delimiter">.</span>begin<span class="Delimiter">());</span> -<span id="L454" class="LineNr">454 </span> assert<span class="Delimiter">(</span>*--literal<span class="Delimiter">.</span>end<span class="Delimiter">()</span> == <span class="Constant">']'</span><span class="Delimiter">);</span> literal<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>--literal<span class="Delimiter">.</span>end<span class="Delimiter">());</span> -<span id="L455" class="LineNr">455 </span> check_string<span class="Delimiter">(</span>address<span class="Delimiter">,</span> literal<span class="Delimiter">);</span> +<span id="L454" class="LineNr">454 </span> assert<span class="Delimiter">(</span>*--literal<span class="Delimiter">.</span><a href='003trace.cc.html#L195'>end</a><span class="Delimiter">()</span> == <span class="Constant">']'</span><span class="Delimiter">);</span> literal<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>--literal<span class="Delimiter">.</span><a href='003trace.cc.html#L195'>end</a><span class="Delimiter">());</span> +<span id="L455" class="LineNr">455 </span> check_string<span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> literal<span class="Delimiter">);</span> <span id="L456" class="LineNr">456 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L457" class="LineNr">457 </span> <span class="Delimiter">}</span> <span id="L458" class="LineNr">458 </span> <span class="Comment">// End Scenario Type Special-cases</span> -<span id="L459" class="LineNr">459 </span> raise << <span class="Constant">"don't know how to check memory for '"</span> << lhs << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L459" class="LineNr">459 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"don't know how to check memory for '"</span> << lhs << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L460" class="LineNr">460 </span><span class="Delimiter">}</span> <span id="L461" class="LineNr">461 </span> -<span id="L462" class="LineNr">462 </span><span class="Normal">void</span> check_string<span class="Delimiter">(</span><span class="Normal">int</span> address<span class="Delimiter">,</span> <span class="Normal">const</span> string& literal<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L463" class="LineNr">463 </span> trace<span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking string length at "</span> << address << end<span class="Delimiter">();</span> -<span id="L464" class="LineNr">464 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address<span class="Delimiter">)</span> != SIZE<span class="Delimiter">(</span>literal<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L462" class="LineNr">462 </span><span class="Normal">void</span> check_string<span class="Delimiter">(</span><span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> <span class="Normal">const</span> string& literal<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L463" class="LineNr">463 </span> <a href='003trace.cc.html#L171'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking string length at "</span> << <a href='043space.cc.html#L76'>address</a> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L464" class="LineNr">464 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">)</span> != <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L465" class="LineNr">465 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> -<span id="L466" class="LineNr">466 </span> raise << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location '"</span> << address << <span class="Constant">"' to contain length "</span> << SIZE<span class="Delimiter">(</span>literal<span class="Delimiter">)</span> << <span class="Constant">" of string ["</span> << literal << <span class="Constant">"] but saw "</span> << 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="Constant">" ("</span> << read_mu_text<span class="Delimiter">(</span>address-<span class="Comment">/*</span><span class="Comment">fake refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">)</span> << <span class="Constant">")</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L466" class="LineNr">466 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location '"</span> << address << <span class="Constant">"' to contain length "</span> << <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">)</span> << <span class="Constant">" of string ["</span> << literal << <span class="Constant">"] but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="Constant">" ("</span> << <a href='038new_text.cc.html#L143'>read_mu_text</a><span class="Delimiter">(</span>address-<span class="Comment">/*</span><span class="Comment">fake refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">)</span> << <span class="Constant">")</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L467" class="LineNr">467 </span> <span class="Normal">else</span> -<span id="L468" class="LineNr">468 </span> raise << <span class="Constant">"expected location '"</span> << address << <span class="Constant">"' to contain length "</span> << SIZE<span class="Delimiter">(</span>literal<span class="Delimiter">)</span> << <span class="Constant">" of string ["</span> << literal << <span class="Constant">"] but saw "</span> << 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="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L468" class="LineNr">468 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"expected location '"</span> << address << <span class="Constant">"' to contain length "</span> << <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">)</span> << <span class="Constant">" of string ["</span> << literal << <span class="Constant">"] but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L469" class="LineNr">469 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L470" class="LineNr">470 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L471" class="LineNr">471 </span> <span class="Delimiter">}</span> <span id="L472" class="LineNr">472 </span> ++address<span class="Delimiter">;</span> <span class="Comment">// now skip length</span> -<span id="L473" class="LineNr">473 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>literal<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L474" class="LineNr">474 </span> trace<span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking location "</span> << address+i << end<span class="Delimiter">();</span> -<span id="L475" class="LineNr">475 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">)</span> != literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L473" class="LineNr">473 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>literal<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L474" class="LineNr">474 </span> <a href='003trace.cc.html#L171'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"checking location "</span> << address+i << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L475" class="LineNr">475 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">)</span> != literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L476" class="LineNr">476 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L477" class="LineNr">477 </span> <span class="Comment">// genuine test in a .mu file</span> -<span id="L478" class="LineNr">478 </span> raise << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location "</span> << <span class="Delimiter">(</span>address+i<span class="Delimiter">)</span> << <span class="Constant">" to contain "</span> << literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="Constant">" ('"</span> << <span class="Normal">static_cast</span><<span class="Normal">char</span>><span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="Constant">"')</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L478" class="LineNr">478 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": expected location "</span> << <span class="Delimiter">(</span>address+i<span class="Delimiter">)</span> << <span class="Constant">" to contain "</span> << literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="Constant">" ('"</span> << <span class="Normal">static_cast</span><<span class="Normal">char</span>><span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="Constant">"')</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L479" class="LineNr">479 </span> <span class="Delimiter">}</span> <span id="L480" class="LineNr">480 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L481" class="LineNr">481 </span> <span class="Comment">// just testing scenario support</span> -<span id="L482" class="LineNr">482 </span> raise << <span class="Constant">"expected location "</span> << <span class="Delimiter">(</span>address+i<span class="Delimiter">)</span> << <span class="Constant">" to contain "</span> << literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span>get_or_insert<span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L482" class="LineNr">482 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"expected location "</span> << <span class="Delimiter">(</span>address+i<span class="Delimiter">)</span> << <span class="Constant">" to contain "</span> << literal<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> << <span class="Constant">" but saw "</span> << no_scientific<span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L483" class="LineNr">483 </span> <span class="Delimiter">}</span> <span id="L484" class="LineNr">484 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L485" class="LineNr">485 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> @@ -553,7 +553,7 @@ if ('onhashchange' in window) { <span id="L490" class="LineNr">490 </span><span class="Delimiter">:(scenario memory_check_multiple)</span> <span id="L491" class="LineNr">491 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L492" class="LineNr">492 </span><span class="Special">% Hide_errors = true;</span> -<span id="L493" class="LineNr">493 </span><span class="muRecipe">def</span> main [ +<span id="L493" class="LineNr">493 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L494" class="LineNr">494 </span> memory-should-contain [ <span id="L495" class="LineNr">495 </span> <span class="Constant">1</span><span class="Special"> <- </span><span class="Constant">0</span> <span id="L496" class="LineNr">496 </span> <span class="Constant">1</span><span class="Special"> <- </span><span class="Constant">0</span> @@ -564,7 +564,7 @@ if ('onhashchange' in window) { <span id="L501" class="LineNr">501 </span><span class="Delimiter">:(scenario memory_check_string_length)</span> <span id="L502" class="LineNr">502 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L503" class="LineNr">503 </span><span class="Special">% Hide_errors = true;</span> -<span id="L504" class="LineNr">504 </span><span class="muRecipe">def</span> main [ +<span id="L504" class="LineNr">504 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L505" class="LineNr">505 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">3</span> <span id="L506" class="LineNr">506 </span> <span class="Constant">2</span>:num<span class="Special"> <- </span>copy <span class="Constant">97</span> <span class="Comment"># 'a'</span> <span id="L507" class="LineNr">507 </span> <span class="Constant">3</span>:num<span class="Special"> <- </span>copy <span class="Constant">98</span> <span class="Comment"># 'b'</span> @@ -576,7 +576,7 @@ if ('onhashchange' in window) { <span id="L513" class="LineNr">513 </span><span class="traceContains">+error: expected location '1' to contain length 2 of string [ab] but saw 3</span> <span id="L514" class="LineNr">514 </span> <span id="L515" class="LineNr">515 </span><span class="Delimiter">:(scenario memory_check_string)</span> -<span id="L516" class="LineNr">516 </span><span class="muRecipe">def</span> main [ +<span id="L516" class="LineNr">516 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L517" class="LineNr">517 </span> <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">3</span> <span id="L518" class="LineNr">518 </span> <span class="Constant">2</span>:num<span class="Special"> <- </span>copy <span class="Constant">97</span> <span class="Comment"># 'a'</span> <span id="L519" class="LineNr">519 </span> <span class="Constant">3</span>:num<span class="Special"> <- </span>copy <span class="Constant">98</span> <span class="Comment"># 'b'</span> @@ -593,7 +593,7 @@ if ('onhashchange' in window) { <span id="L530" class="LineNr">530 </span><span class="Delimiter">:(scenario memory_invalid_string_check)</span> <span id="L531" class="LineNr">531 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L532" class="LineNr">532 </span><span class="Special">% Hide_errors = true;</span> -<span id="L533" class="LineNr">533 </span><span class="muRecipe">def</span> main [ +<span id="L533" class="LineNr">533 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L534" class="LineNr">534 </span> memory-should-contain [ <span id="L535" class="LineNr">535 </span> <span class="Constant">1</span><span class="Special"> <- </span>[abc] <span id="L536" class="LineNr">536 </span> ] @@ -603,7 +603,7 @@ if ('onhashchange' in window) { <span id="L540" class="LineNr">540 </span><span class="Delimiter">:(scenario memory_check_with_comment)</span> <span id="L541" class="LineNr">541 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L542" class="LineNr">542 </span><span class="Special">% Hide_errors = true;</span> -<span id="L543" class="LineNr">543 </span><span class="muRecipe">def</span> main [ +<span id="L543" class="LineNr">543 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L544" class="LineNr">544 </span> memory-should-contain [ <span id="L545" class="LineNr">545 </span> <span class="Constant">1</span><span class="Special"> <- </span><span class="Constant">34</span> <span class="Comment"># comment</span> <span id="L546" class="LineNr">546 </span> ] @@ -619,18 +619,18 @@ if ('onhashchange' in window) { <span id="L556" class="LineNr">556 </span><span class="Delimiter">:(scenario trace_check_fails)</span> <span id="L557" class="LineNr">557 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L558" class="LineNr">558 </span><span class="Special">% Hide_errors = true;</span> -<span id="L559" class="LineNr">559 </span><span class="muRecipe">def</span> main [ +<span id="L559" class="LineNr">559 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L560" class="LineNr">560 </span> trace-should-contain [ <span id="L561" class="LineNr">561 </span> <span class="Normal">a</span>: b <span id="L562" class="LineNr">562 </span> <span class="Normal">a</span>: d <span id="L563" class="LineNr">563 </span> ] <span id="L564" class="LineNr">564 </span>] -<span id="L565" class="LineNr">565 </span><span class="traceContains">+error: missing [b] in trace with label 'a'</span> +<span id="L565" class="LineNr">565 </span><span class="traceContains">+error: missing [b] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> <span id="L566" class="LineNr">566 </span> <span id="L567" class="LineNr">567 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L568" class="LineNr">568 </span>TRACE_SHOULD_CONTAIN<span class="Delimiter">,</span> <span id="L569" class="LineNr">569 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L570" class="LineNr">570 </span>put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"trace-should-contain"</span><span class="Delimiter">,</span> TRACE_SHOULD_CONTAIN<span class="Delimiter">);</span> +<span id="L570" class="LineNr">570 </span><a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"trace-should-contain"</span><span class="Delimiter">,</span> TRACE_SHOULD_CONTAIN<span class="Delimiter">);</span> <span id="L571" class="LineNr">571 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L572" class="LineNr">572 </span><span class="Normal">case</span> TRACE_SHOULD_CONTAIN: <span class="Delimiter">{</span> <span id="L573" class="LineNr">573 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -646,41 +646,41 @@ if ('onhashchange' in window) { <span id="L583" class="LineNr">583 </span><span class="Comment">// simplified version of check_trace_contents() that emits errors rather</span> <span id="L584" class="LineNr">584 </span><span class="Comment">// than just printing to stderr</span> <span id="L585" class="LineNr">585 </span><span class="Normal">void</span> check_trace<span class="Delimiter">(</span><span class="Normal">const</span> string& expected<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L586" class="LineNr">586 </span> Trace_stream<span class="Delimiter">-></span>newline<span class="Delimiter">();</span> +<span id="L586" class="LineNr">586 </span> Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L137'>newline</a><span class="Delimiter">();</span> <span id="L587" class="LineNr">587 </span> vector<trace_line> expected_lines = parse_trace<span class="Delimiter">(</span>expected<span class="Delimiter">);</span> <span id="L588" class="LineNr">588 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L589" class="LineNr">589 </span> <span class="Normal">int</span> curr_expected_line = <span class="Constant">0</span><span class="Delimiter">;</span> -<span id="L590" class="LineNr">590 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L590" class="LineNr">590 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<trace_line>::iterator p = Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Trace_stream<span class="Delimiter">-></span>past_lines<span class="Delimiter">.</span><a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L591" class="LineNr">591 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label != p<span class="Delimiter">-></span>label<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> -<span id="L592" class="LineNr">592 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents != trim<span class="Delimiter">(</span>p<span class="Delimiter">-></span>contents<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> +<span id="L592" class="LineNr">592 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents != <a href='003trace.cc.html#L365'>trim</a><span class="Delimiter">(</span>p<span class="Delimiter">-></span>contents<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L593" class="LineNr">593 </span> <span class="Comment">// match</span> <span id="L594" class="LineNr">594 </span> ++curr_expected_line<span class="Delimiter">;</span> -<span id="L595" class="LineNr">595 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>curr_expected_line == SIZE<span class="Delimiter">(</span>expected_lines<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> +<span id="L595" class="LineNr">595 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>curr_expected_line == <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L596" class="LineNr">596 </span> <span class="Delimiter">}</span> <span id="L597" class="LineNr">597 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> -<span id="L598" class="LineNr">598 </span> raise << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": missing ["</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents << <span class="Constant">"] "</span> -<span id="L599" class="LineNr">599 </span> << <span class="Constant">"in trace with label '"</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L598" class="LineNr">598 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": missing ["</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents << <span class="Constant">"] "</span> +<span id="L599" class="LineNr">599 </span> << <span class="Constant">"in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L600" class="LineNr">600 </span> <span class="Normal">else</span> -<span id="L601" class="LineNr">601 </span> raise << <span class="Constant">"missing ["</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents << <span class="Constant">"] "</span> -<span id="L602" class="LineNr">602 </span> << <span class="Constant">"in trace with label '"</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L601" class="LineNr">601 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"missing ["</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>contents << <span class="Constant">"] "</span> +<span id="L602" class="LineNr">602 </span> << <span class="Constant">"in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L603" class="LineNr">603 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Hide_errors<span class="Delimiter">)</span> -<span id="L604" class="LineNr">604 </span> DUMP<span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label<span class="Delimiter">);</span> +<span id="L604" class="LineNr">604 </span> <a href='003trace.cc.html#L175'>DUMP</a><span class="Delimiter">(</span>expected_lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>curr_expected_line<span class="Delimiter">).</span>label<span class="Delimiter">);</span> <span id="L605" class="LineNr">605 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L606" class="LineNr">606 </span><span class="Delimiter">}</span> <span id="L607" class="LineNr">607 </span> <span id="L608" class="LineNr">608 </span>vector<trace_line> parse_trace<span class="Delimiter">(</span><span class="Normal">const</span> string& expected<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L609" class="LineNr">609 </span> vector<string> buf = split<span class="Delimiter">(</span>expected<span class="Delimiter">,</span> <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> +<span id="L609" class="LineNr">609 </span> vector<string> buf = <a href='003trace.cc.html#L341'>split</a><span class="Delimiter">(</span>expected<span class="Delimiter">,</span> <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> <span id="L610" class="LineNr">610 </span> vector<trace_line> result<span class="Delimiter">;</span> -<span id="L611" class="LineNr">611 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>buf<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L612" class="LineNr">612 </span> buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> = trim<span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> +<span id="L611" class="LineNr">611 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>buf<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L612" class="LineNr">612 </span> buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)</span> = <a href='003trace.cc.html#L365'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> <span id="L613" class="LineNr">613 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>empty<span class="Delimiter">())</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L614" class="LineNr">614 </span> <span class="Normal">int</span> delim = buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>find<span class="Delimiter">(</span><span class="Constant">": "</span><span class="Delimiter">);</span> <span id="L615" class="LineNr">615 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>delim == -<span class="Constant">1</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L616" class="LineNr">616 </span> raise << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": lines in 'trace-should-contain' should be of the form <label>: <contents>. Both parts are required.</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> -<span id="L617" class="LineNr">617 </span> result<span class="Delimiter">.</span>clear<span class="Delimiter">();</span> +<span id="L616" class="LineNr">616 </span> <a href='003trace.cc.html#L178'>raise</a> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": lines in 'trace-should-contain' should be of the form <label>: <contents>. Both parts are required.</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L617" class="LineNr">617 </span> result<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L618" class="LineNr">618 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L619" class="LineNr">619 </span> <span class="Delimiter">}</span> -<span id="L620" class="LineNr">620 </span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>trace_line<span class="Delimiter">(</span>trim<span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>substr<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> delim<span class="Delimiter">)),</span> trim<span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>substr<span class="Delimiter">(</span>delim+<span class="Constant">2</span><span class="Delimiter">))));</span> +<span id="L620" class="LineNr">620 </span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>trace_line<span class="Delimiter">(</span><a href='003trace.cc.html#L365'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>substr<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">,</span> delim<span class="Delimiter">)),</span> <a href='003trace.cc.html#L365'>trim</a><span class="Delimiter">(</span>buf<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>substr<span class="Delimiter">(</span>delim+<span class="Constant">2</span><span class="Delimiter">))));</span> <span id="L621" class="LineNr">621 </span> <span class="Delimiter">}</span> <span id="L622" class="LineNr">622 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L623" class="LineNr">623 </span><span class="Delimiter">}</span> @@ -688,28 +688,28 @@ if ('onhashchange' in window) { <span id="L625" class="LineNr">625 </span><span class="Delimiter">:(scenario trace_check_fails_in_nonfirst_line)</span> <span id="L626" class="LineNr">626 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L627" class="LineNr">627 </span><span class="Special">% Hide_errors = true;</span> -<span id="L628" class="LineNr">628 </span><span class="muRecipe">def</span> main [ +<span id="L628" class="LineNr">628 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L629" class="LineNr">629 </span> run [ -<span id="L630" class="LineNr">630 </span> trace <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] +<span id="L630" class="LineNr">630 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] <span id="L631" class="LineNr">631 </span> ] <span id="L632" class="LineNr">632 </span> trace-should-contain [ <span id="L633" class="LineNr">633 </span> <span class="Normal">a</span>: b <span id="L634" class="LineNr">634 </span> <span class="Normal">a</span>: d <span id="L635" class="LineNr">635 </span> ] <span id="L636" class="LineNr">636 </span>] -<span id="L637" class="LineNr">637 </span><span class="traceContains">+error: missing [d] in trace with label 'a'</span> +<span id="L637" class="LineNr">637 </span><span class="traceContains">+error: missing [d] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> <span id="L638" class="LineNr">638 </span> <span id="L639" class="LineNr">639 </span><span class="Delimiter">:(scenario trace_check_passes_silently)</span> <span id="L640" class="LineNr">640 </span><span class="Special">% Scenario_testing_scenario = true;</span> -<span id="L641" class="LineNr">641 </span><span class="muRecipe">def</span> main [ +<span id="L641" class="LineNr">641 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L642" class="LineNr">642 </span> run [ -<span id="L643" class="LineNr">643 </span> trace <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] +<span id="L643" class="LineNr">643 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] <span id="L644" class="LineNr">644 </span> ] <span id="L645" class="LineNr">645 </span> trace-should-contain [ <span id="L646" class="LineNr">646 </span> <span class="Normal">a</span>: b <span id="L647" class="LineNr">647 </span> ] <span id="L648" class="LineNr">648 </span>] -<span id="L649" class="LineNr">649 </span><span class="traceAbsent">-error: missing [b] in trace with label 'a'</span> +<span id="L649" class="LineNr">649 </span><span class="traceAbsent">-error: missing [b] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> <span id="L650" class="LineNr">650 </span>$error: <span class="Constant">0</span> <span id="L651" class="LineNr">651 </span> <span id="L652" class="LineNr">652 </span><span class="Comment">//: 'trace-should-not-contain' is like the '-' lines in our scenarios so far</span> @@ -719,20 +719,20 @@ if ('onhashchange' in window) { <span id="L656" class="LineNr">656 </span><span class="Delimiter">:(scenario trace_negative_check_fails)</span> <span id="L657" class="LineNr">657 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L658" class="LineNr">658 </span><span class="Special">% Hide_errors = true;</span> -<span id="L659" class="LineNr">659 </span><span class="muRecipe">def</span> main [ +<span id="L659" class="LineNr">659 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L660" class="LineNr">660 </span> run [ -<span id="L661" class="LineNr">661 </span> trace <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] +<span id="L661" class="LineNr">661 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [b] <span id="L662" class="LineNr">662 </span> ] <span id="L663" class="LineNr">663 </span> trace-should-<span class="Normal">not</span>-contain [ <span id="L664" class="LineNr">664 </span> <span class="Normal">a</span>: b <span id="L665" class="LineNr">665 </span> ] <span id="L666" class="LineNr">666 </span>] -<span id="L667" class="LineNr">667 </span><span class="traceContains">+error: unexpected [b] in trace with label 'a'</span> +<span id="L667" class="LineNr">667 </span><span class="traceContains">+error: unexpected [b] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> <span id="L668" class="LineNr">668 </span> <span id="L669" class="LineNr">669 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L670" class="LineNr">670 </span>TRACE_SHOULD_NOT_CONTAIN<span class="Delimiter">,</span> <span id="L671" class="LineNr">671 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L672" class="LineNr">672 </span>put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"trace-should-not-contain"</span><span class="Delimiter">,</span> TRACE_SHOULD_NOT_CONTAIN<span class="Delimiter">);</span> +<span id="L672" class="LineNr">672 </span><a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"trace-should-not-contain"</span><span class="Delimiter">,</span> TRACE_SHOULD_NOT_CONTAIN<span class="Delimiter">);</span> <span id="L673" class="LineNr">673 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L674" class="LineNr">674 </span><span class="Normal">case</span> TRACE_SHOULD_NOT_CONTAIN: <span class="Delimiter">{</span> <span id="L675" class="LineNr">675 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -748,11 +748,11 @@ if ('onhashchange' in window) { <span id="L685" class="LineNr">685 </span><span class="Comment">// simplified version of check_trace_contents() that emits errors rather</span> <span id="L686" class="LineNr">686 </span><span class="Comment">// than just printing to stderr</span> <span id="L687" class="LineNr">687 </span><span class="Normal">bool</span> check_trace_missing<span class="Delimiter">(</span><span class="Normal">const</span> string& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L688" class="LineNr">688 </span> Trace_stream<span class="Delimiter">-></span>newline<span class="Delimiter">();</span> +<span id="L688" class="LineNr">688 </span> Trace_stream<span class="Delimiter">-></span><a href='003trace.cc.html#L137'>newline</a><span class="Delimiter">();</span> <span id="L689" class="LineNr">689 </span> vector<trace_line> lines = parse_trace<span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L690" class="LineNr">690 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>lines<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L690" class="LineNr">690 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>lines<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L691" class="LineNr">691 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>trace_count<span class="Delimiter">(</span>lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>label<span class="Delimiter">,</span> lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>contents<span class="Delimiter">)</span> != <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L692" class="LineNr">692 </span> raise << <span class="Constant">"unexpected ["</span> << lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>contents << <span class="Constant">"] in trace with label '"</span> << lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L692" class="LineNr">692 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"unexpected ["</span> << lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>contents << <span class="Constant">"] in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << lines<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>label << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L693" class="LineNr">693 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L694" class="LineNr">694 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L695" class="LineNr">695 </span> <span class="Delimiter">}</span> @@ -762,32 +762,32 @@ if ('onhashchange' in window) { <span id="L699" class="LineNr">699 </span> <span id="L700" class="LineNr">700 </span><span class="Delimiter">:(scenario trace_negative_check_passes_silently)</span> <span id="L701" class="LineNr">701 </span><span class="Special">% Scenario_testing_scenario = true;</span> -<span id="L702" class="LineNr">702 </span><span class="muRecipe">def</span> main [ +<span id="L702" class="LineNr">702 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L703" class="LineNr">703 </span> trace-should-<span class="Normal">not</span>-contain [ <span id="L704" class="LineNr">704 </span> <span class="Normal">a</span>: b <span id="L705" class="LineNr">705 </span> ] <span id="L706" class="LineNr">706 </span>] -<span id="L707" class="LineNr">707 </span><span class="traceAbsent">-error: unexpected [b] in trace with label 'a'</span> +<span id="L707" class="LineNr">707 </span><span class="traceAbsent">-error: unexpected [b] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> <span id="L708" class="LineNr">708 </span>$error: <span class="Constant">0</span> <span id="L709" class="LineNr">709 </span> <span id="L710" class="LineNr">710 </span><span class="Delimiter">:(scenario trace_negative_check_fails_on_any_unexpected_line)</span> <span id="L711" class="LineNr">711 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L712" class="LineNr">712 </span><span class="Special">% Hide_errors = true;</span> -<span id="L713" class="LineNr">713 </span><span class="muRecipe">def</span> main [ +<span id="L713" class="LineNr">713 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L714" class="LineNr">714 </span> run [ -<span id="L715" class="LineNr">715 </span> trace <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [d] +<span id="L715" class="LineNr">715 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [d] <span id="L716" class="LineNr">716 </span> ] <span id="L717" class="LineNr">717 </span> trace-should-<span class="Normal">not</span>-contain [ <span id="L718" class="LineNr">718 </span> <span class="Normal">a</span>: b <span id="L719" class="LineNr">719 </span> <span class="Normal">a</span>: d <span id="L720" class="LineNr">720 </span> ] <span id="L721" class="LineNr">721 </span>] -<span id="L722" class="LineNr">722 </span><span class="traceContains">+error: unexpected [d] in trace with label 'a'</span> +<span id="L722" class="LineNr">722 </span><span class="traceContains">+error: unexpected [d] in <a href='003trace.cc.html#L171'>trace</a> with label 'a'</span> <span id="L723" class="LineNr">723 </span> <span id="L724" class="LineNr">724 </span><span class="Delimiter">:(scenario trace_count_check)</span> -<span id="L725" class="LineNr">725 </span><span class="muRecipe">def</span> main [ +<span id="L725" class="LineNr">725 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L726" class="LineNr">726 </span> run [ -<span id="L727" class="LineNr">727 </span> trace <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo] +<span id="L727" class="LineNr">727 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo] <span id="L728" class="LineNr">728 </span> ] <span id="L729" class="LineNr">729 </span> check-trace-count-<span class="Normal">for</span>-label <span class="Constant">1</span><span class="Delimiter">,</span> [a] <span id="L730" class="LineNr">730 </span>] @@ -796,19 +796,19 @@ if ('onhashchange' in window) { <span id="L733" class="LineNr">733 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L734" class="LineNr">734 </span>CHECK_TRACE_COUNT_FOR_LABEL<span class="Delimiter">,</span> <span id="L735" class="LineNr">735 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L736" class="LineNr">736 </span>put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"check-trace-count-for-label"</span><span class="Delimiter">,</span> CHECK_TRACE_COUNT_FOR_LABEL<span class="Delimiter">);</span> +<span id="L736" class="LineNr">736 </span><a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"check-trace-count-for-label"</span><span class="Delimiter">,</span> CHECK_TRACE_COUNT_FOR_LABEL<span class="Delimiter">);</span> <span id="L737" class="LineNr">737 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L738" class="LineNr">738 </span><span class="Normal">case</span> CHECK_TRACE_COUNT_FOR_LABEL: <span class="Delimiter">{</span> -<span id="L739" class="LineNr">739 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L740" class="LineNr">740 </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">"'check-trace-count-for-label' requires exactly two ingredients, 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 id="L739" class="LineNr">739 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L740" class="LineNr">740 </span> <a href='003trace.cc.html#L178'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><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">"'check-trace-count-for-label' requires exactly two ingredients, but got '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L741" class="LineNr">741 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L742" class="LineNr">742 </span> <span class="Delimiter">}</span> <span id="L743" class="LineNr">743 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_number<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 id="L744" class="LineNr">744 </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 'check-trace-count-for-label' should be a number (count), 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 id="L744" class="LineNr">744 </span> <a href='003trace.cc.html#L178'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><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 'check-trace-count-for-label' should be a number (count), 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> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L745" class="LineNr">745 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L746" class="LineNr">746 </span> <span class="Delimiter">}</span> <span id="L747" class="LineNr">747 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_literal_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> -<span id="L748" class="LineNr">748 </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">"second ingredient of 'check-trace-count-for-label' should be a literal string (label), but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</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 id="L748" class="LineNr">748 </span> <a href='003trace.cc.html#L178'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><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">"second ingredient of 'check-trace-count-for-label' should be a literal string (label), but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L749" class="LineNr">749 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L750" class="LineNr">750 </span> <span class="Delimiter">}</span> <span id="L751" class="LineNr">751 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -822,12 +822,12 @@ if ('onhashchange' in window) { <span id="L759" class="LineNr">759 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>count != expected_count<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L760" class="LineNr">760 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Current_scenario && !Scenario_testing_scenario<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L761" class="LineNr">761 </span> <span class="Comment">// genuine test in a .mu file</span> -<span id="L762" class="LineNr">762 </span> raise << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": "</span> << maybe<span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"expected "</span> << expected_count << <span class="Constant">" lines in trace with label '"</span> << label << <span class="Constant">"' in trace: "</span> << end<span class="Delimiter">();</span> -<span id="L763" class="LineNr">763 </span> DUMP<span class="Delimiter">(</span>label<span class="Delimiter">);</span> +<span id="L762" class="LineNr">762 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"</span><span class="cSpecial">\n</span><span class="Constant">F - "</span> << Current_scenario<span class="Delimiter">-></span>name << <span class="Constant">": "</span> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"expected "</span> << expected_count << <span class="Constant">" lines in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << label << <span class="Constant">"' in <a href='003trace.cc.html#L171'>trace</a>: "</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> +<span id="L763" class="LineNr">763 </span> <a href='003trace.cc.html#L175'>DUMP</a><span class="Delimiter">(</span>label<span class="Delimiter">);</span> <span id="L764" class="LineNr">764 </span> <span class="Delimiter">}</span> <span id="L765" class="LineNr">765 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L766" class="LineNr">766 </span> <span class="Comment">// just testing scenario support</span> -<span id="L767" class="LineNr">767 </span> raise << maybe<span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"expected "</span> << expected_count << <span class="Constant">" lines in trace with label '"</span> << label << <span class="Constant">"' in trace</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L767" class="LineNr">767 </span> <a href='003trace.cc.html#L178'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>current_recipe_name<span class="Delimiter">())</span> << <span class="Constant">"expected "</span> << expected_count << <span class="Constant">" lines in <a href='003trace.cc.html#L171'>trace</a> with label '"</span> << label << <span class="Constant">"' in <a href='003trace.cc.html#L171'>trace</a></span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L768" class="LineNr">768 </span> <span class="Delimiter">}</span> <span id="L769" class="LineNr">769 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!Scenario_testing_scenario<span class="Delimiter">)</span> Passed = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L770" class="LineNr">770 </span> <span class="Delimiter">}</span> @@ -837,13 +837,13 @@ if ('onhashchange' in window) { <span id="L774" class="LineNr">774 </span><span class="Delimiter">:(scenario trace_count_check_2)</span> <span id="L775" class="LineNr">775 </span><span class="Special">% Scenario_testing_scenario = true;</span> <span id="L776" class="LineNr">776 </span><span class="Special">% Hide_errors = true;</span> -<span id="L777" class="LineNr">777 </span><span class="muRecipe">def</span> main [ +<span id="L777" class="LineNr">777 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ <span id="L778" class="LineNr">778 </span> run [ -<span id="L779" class="LineNr">779 </span> trace <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo] +<span id="L779" class="LineNr">779 </span> <a href='003trace.cc.html#L171'>trace</a> <span class="Constant">1</span><span class="Delimiter">,</span> [a]<span class="Delimiter">,</span> [foo] <span id="L780" class="LineNr">780 </span> ] <span id="L781" class="LineNr">781 </span> check-trace-count-<span class="Normal">for</span>-label <span class="Constant">2</span><span class="Delimiter">,</span> [a] <span id="L782" class="LineNr">782 </span>] -<span id="L783" class="LineNr">783 </span><span class="traceContains">+error: main: expected 2 lines in trace with label 'a' in trace</span> +<span id="L783" class="LineNr">783 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: expected 2 lines in <a href='003trace.cc.html#L171'>trace</a> with label 'a' in <a href='003trace.cc.html#L171'>trace</a></span> <span id="L784" class="LineNr">784 </span> <span id="L785" class="LineNr">785 </span><span class="Comment">//: Minor detail: ignore 'system' calls in scenarios, since anything we do</span> <span id="L786" class="LineNr">786 </span><span class="Comment">//: with them is by definition impossible to test through Mu.</span> @@ -858,21 +858,21 @@ if ('onhashchange' in window) { <span id="L795" class="LineNr">795 </span>] <span id="L796" class="LineNr">796 </span><span class="traceContains">+error: foo_bar: don't create recipes with '_' in the name</span> <span id="L797" class="LineNr">797 </span> -<span id="L798" class="LineNr">798 </span><span class="Delimiter">:(before "End recipe Fields")</span> +<span id="L798" class="LineNr">798 </span><span class="Delimiter">:(before "End <a href='010vm.cc.html#L19'>recipe</a> Fields")</span> <span id="L799" class="LineNr">799 </span><span class="Normal">bool</span> is_autogenerated<span class="Delimiter">;</span> -<span id="L800" class="LineNr">800 </span><span class="Delimiter">:(before "End recipe Constructor")</span> +<span id="L800" class="LineNr">800 </span><span class="Delimiter">:(before "End <a href='010vm.cc.html#L19'>recipe</a> Constructor")</span> <span id="L801" class="LineNr">801 </span>is_autogenerated = <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L802" class="LineNr">802 </span><span class="Delimiter">:(code)</span> -<span id="L803" class="LineNr">803 </span><span class="Normal">void</span> mark_autogenerated<span class="Delimiter">(</span>recipe_ordinal r<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L803" class="LineNr">803 </span><span class="Normal">void</span> mark_autogenerated<span class="Delimiter">(</span><a href='010vm.cc.html#L14'>recipe_ordinal</a> r<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L804" class="LineNr">804 </span> get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>is_autogenerated = <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L805" class="LineNr">805 </span><span class="Delimiter">}</span> <span id="L806" class="LineNr">806 </span> <span id="L807" class="LineNr">807 </span><span class="Delimiter">:(after "void transform_all()")</span> -<span id="L808" class="LineNr">808 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<recipe_ordinal<span class="Delimiter">,</span> recipe>::iterator p = Recipe<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Recipe<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L808" class="LineNr">808 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<recipe_ordinal<span class="Delimiter">,</span> recipe>::iterator p = Recipe<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Recipe<span class="Delimiter">.</span><a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L809" class="LineNr">809 </span> <span class="Normal">const</span> recipe& r = p<span class="Delimiter">-></span>second<span class="Delimiter">;</span> <span id="L810" class="LineNr">810 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>name<span class="Delimiter">.</span>find<span class="Delimiter">(</span><span class="Constant">'_'</span><span class="Delimiter">)</span> == string::npos<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L811" class="LineNr">811 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>is_autogenerated<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// created by previous call to transform_all()</span> -<span id="L812" class="LineNr">812 </span> raise << r<span class="Delimiter">.</span>name << <span class="Constant">": don't create recipes with '_' in the name</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L812" class="LineNr">812 </span> <a href='003trace.cc.html#L178'>raise</a> << r<span class="Delimiter">.</span>name << <span class="Constant">": don't create recipes with '_' in the name</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L813" class="LineNr">813 </span> <span class="Delimiter">}</span> <span id="L814" class="LineNr">814 </span> <span id="L815" class="LineNr">815 </span><span class="SalientComment">//:: Helpers</span> @@ -882,15 +882,15 @@ if ('onhashchange' in window) { <span id="L819" class="LineNr">819 </span><span class="Normal">void</span> run_mu_scenario<span class="Delimiter">(</span><span class="Normal">const</span> string& form<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L820" class="LineNr">820 </span> istringstream in<span class="Delimiter">(</span>form<span class="Delimiter">);</span> <span id="L821" class="LineNr">821 </span> in >> std::noskipws<span class="Delimiter">;</span> -<span id="L822" class="LineNr">822 </span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L823" class="LineNr">823 </span> string _scenario = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L822" class="LineNr">822 </span> <a href='011load.cc.html#L208'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L823" class="LineNr">823 </span> string _scenario = <a href='011load.cc.html#L166'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L824" class="LineNr">824 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>_scenario<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L825" class="LineNr">825 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L826" class="LineNr">826 </span> raise << <span class="Constant">"no scenario in string passed into run_mu_scenario()</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L826" class="LineNr">826 </span> <a href='003trace.cc.html#L178'>raise</a> << <span class="Constant">"no <a href='050scenario.cc.html#L57'>scenario</a> in string passed into run_mu_scenario()</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L195'>end</a><span class="Delimiter">();</span> <span id="L827" class="LineNr">827 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L828" class="LineNr">828 </span> <span class="Delimiter">}</span> <span id="L829" class="LineNr">829 </span> assert<span class="Delimiter">(</span>_scenario == <span class="Constant">"scenario"</span><span class="Delimiter">);</span> -<span id="L830" class="LineNr">830 </span> scenario s = parse_scenario<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L830" class="LineNr">830 </span> <a href='050scenario.cc.html#L57'>scenario</a> s = <a href='050scenario.cc.html#L84'>parse_scenario</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L831" class="LineNr">831 </span> run_mu_scenario<span class="Delimiter">(</span>s<span class="Delimiter">);</span> <span id="L832" class="LineNr">832 </span><span class="Delimiter">}</span> </pre> |