diff options
Diffstat (limited to 'html/011load.cc.html')
-rw-r--r-- | html/011load.cc.html | 201 |
1 files changed, 101 insertions, 100 deletions
diff --git a/html/011load.cc.html b/html/011load.cc.html index 5aeeb12e..3c89e1a6 100644 --- a/html/011load.cc.html +++ b/html/011load.cc.html @@ -16,16 +16,17 @@ a { text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } +.Conceal { color: #4e4e4e; } .traceAbsent { color: #c00000; } .Special { color: #c00000; } -.muRecipe { color: #ff8700; } -.cSpecial { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .LineNr { color: #444444; } -.traceContains { color: #008000; } -.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .Identifier { color: #c0a020; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.cSpecial { color: #008000; } +.traceContains { color: #008000; } --> </style> @@ -85,28 +86,28 @@ if ('onhashchange' in window) { <span id="L23" class="LineNr"> 23 </span> in >> std::noskipws<span class="Delimiter">;</span> <span id="L24" class="LineNr"> 24 </span> vector<recipe_ordinal> result<span class="Delimiter">;</span> <span id="L25" class="LineNr"> 25 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L26" class="LineNr"> 26 </span> <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L27" class="LineNr"> 27 </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="L28" class="LineNr"> 28 </span> string command = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L29" class="LineNr"> 29 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>command<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> -<span id="L30" class="LineNr"> 30 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L31" class="LineNr"> 31 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> -<span id="L32" class="LineNr"> 32 </span> <span class="Delimiter">}</span> -<span id="L33" class="LineNr"> 33 </span> <span class="Comment">// Command Handlers</span> -<span id="L34" class="LineNr"> 34 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>command == <span class="Constant">"recipe"</span> || command == <span class="Constant">"def"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L35" class="LineNr"> 35 </span> <a href='010vm.cc.html#L14'>recipe_ordinal</a> r = <a href='011load.cc.html#L53'>slurp_recipe</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L36" class="LineNr"> 36 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>r > <span class="Constant">0</span><span class="Delimiter">)</span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>r<span class="Delimiter">);</span> -<span id="L37" class="LineNr"> 37 </span> <span class="Delimiter">}</span> -<span id="L38" class="LineNr"> 38 </span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>command == <span class="Constant">"recipe!"</span> || command == <span class="Constant">"def!"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L39" class="LineNr"> 39 </span> Disable_redefine_checks = <span class="Constant">true</span><span class="Delimiter">;</span> -<span id="L40" class="LineNr"> 40 </span> <a href='010vm.cc.html#L14'>recipe_ordinal</a> r = <a href='011load.cc.html#L53'>slurp_recipe</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L41" class="LineNr"> 41 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>r > <span class="Constant">0</span><span class="Delimiter">)</span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>r<span class="Delimiter">);</span> -<span id="L42" class="LineNr"> 42 </span> Disable_redefine_checks = <span class="Constant">false</span><span class="Delimiter">;</span> -<span id="L43" class="LineNr"> 43 </span> <span class="Delimiter">}</span> -<span id="L44" class="LineNr"> 44 </span> <span class="Comment">// End Command Handlers</span> -<span id="L45" class="LineNr"> 45 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> -<span id="L46" class="LineNr"> 46 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"unknown top-level command: "</span> << command << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L47" class="LineNr"> 47 </span> <span class="Delimiter">}</span> +<span id="L26" class="LineNr"> 26 </span> <span class="Conceal">¦</span> <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L27" class="LineNr"> 27 </span> <span class="Conceal">¦</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="L28" class="LineNr"> 28 </span> <span class="Conceal">¦</span> string command = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L29" class="LineNr"> 29 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>command<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> +<span id="L30" class="LineNr"> 30 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> +<span id="L31" class="LineNr"> 31 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span> +<span id="L32" class="LineNr"> 32 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L33" class="LineNr"> 33 </span> <span class="Conceal">¦</span> <span class="Comment">// Command Handlers</span> +<span id="L34" class="LineNr"> 34 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>command == <span class="Constant">"recipe"</span> || command == <span class="Constant">"def"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L35" class="LineNr"> 35 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='010vm.cc.html#L14'>recipe_ordinal</a> r = <a href='011load.cc.html#L53'>slurp_recipe</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L36" class="LineNr"> 36 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>r > <span class="Constant">0</span><span class="Delimiter">)</span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>r<span class="Delimiter">);</span> +<span id="L37" class="LineNr"> 37 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L38" class="LineNr"> 38 </span> <span class="Conceal">¦</span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>command == <span class="Constant">"recipe!"</span> || command == <span class="Constant">"def!"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L39" class="LineNr"> 39 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> Disable_redefine_checks = <span class="Constant">true</span><span class="Delimiter">;</span> +<span id="L40" class="LineNr"> 40 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='010vm.cc.html#L14'>recipe_ordinal</a> r = <a href='011load.cc.html#L53'>slurp_recipe</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L41" class="LineNr"> 41 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>r > <span class="Constant">0</span><span class="Delimiter">)</span> result<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>r<span class="Delimiter">);</span> +<span id="L42" class="LineNr"> 42 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> Disable_redefine_checks = <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L43" class="LineNr"> 43 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L44" class="LineNr"> 44 </span> <span class="Conceal">¦</span> <span class="Comment">// End Command Handlers</span> +<span id="L45" class="LineNr"> 45 </span> <span class="Conceal">¦</span> <span class="Normal">else</span> <span class="Delimiter">{</span> +<span id="L46" class="LineNr"> 46 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"unknown top-level command: "</span> << command << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L47" class="LineNr"> 47 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> <span id="L48" class="LineNr"> 48 </span> <span class="Delimiter">}</span> <span id="L49" class="LineNr"> 49 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L50" class="LineNr"> 50 </span><span class="Delimiter">}</span> @@ -116,23 +117,23 @@ if ('onhashchange' in window) { <span id="L54" class="LineNr"> 54 </span> <a href='010vm.cc.html#L19'>recipe</a> result<span class="Delimiter">;</span> <span id="L55" class="LineNr"> 55 </span> result<span class="Delimiter">.</span>name = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L56" class="LineNr"> 56 </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="L57" class="LineNr"> 57 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L58" class="LineNr"> 58 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"file ended with 'recipe'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L59" class="LineNr"> 59 </span> <span class="Identifier">return</span> -<span class="Constant">1</span><span class="Delimiter">;</span> +<span id="L57" class="LineNr"> 57 </span> <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> +<span id="L58" class="LineNr"> 58 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"file ended with 'recipe'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L59" class="LineNr"> 59 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> -<span class="Constant">1</span><span class="Delimiter">;</span> <span id="L60" class="LineNr"> 60 </span> <span class="Delimiter">}</span> <span id="L61" class="LineNr"> 61 </span> <span class="Comment">// End Load Recipe Name</span> <span id="L62" class="LineNr"> 62 </span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L63" class="LineNr"> 63 </span> <span class="Comment">// End Recipe Refinements</span> <span id="L64" class="LineNr"> 64 </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="L65" class="LineNr"> 65 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"empty result.name</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L65" class="LineNr"> 65 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"empty result.name</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L66" class="LineNr"> 66 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">"--- defining "</span> << result<span class="Delimiter">.</span>name << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L67" class="LineNr"> 67 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> result<span class="Delimiter">.</span>name<span class="Delimiter">))</span> -<span id="L68" class="LineNr"> 68 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> result<span class="Delimiter">.</span>name<span class="Delimiter">,</span> Next_recipe_ordinal++<span class="Delimiter">);</span> +<span id="L68" class="LineNr"> 68 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> result<span class="Delimiter">.</span>name<span class="Delimiter">,</span> Next_recipe_ordinal++<span class="Delimiter">);</span> <span id="L69" class="LineNr"> 69 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>Recipe<span class="Delimiter">.</span>find<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> result<span class="Delimiter">.</span>name<span class="Delimiter">))</span> != Recipe<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> <span class="Delimiter">{</span> -<span id="L70" class="LineNr"> 70 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">"already exists"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L71" class="LineNr"> 71 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='011load.cc.html#L378'>should_check_for_redefine</a><span class="Delimiter">(</span>result<span class="Delimiter">.</span>name<span class="Delimiter">))</span> -<span id="L72" class="LineNr"> 72 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"redefining <a href='010vm.cc.html#L19'>recipe</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#L185'>end</a><span class="Delimiter">();</span> -<span id="L73" class="LineNr"> 73 </span> Recipe<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> result<span class="Delimiter">.</span>name<span class="Delimiter">));</span> +<span id="L70" class="LineNr"> 70 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">"already exists"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L71" class="LineNr"> 71 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='011load.cc.html#L378'>should_check_for_redefine</a><span class="Delimiter">(</span>result<span class="Delimiter">.</span>name<span class="Delimiter">))</span> +<span id="L72" class="LineNr"> 72 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"redefining <a href='010vm.cc.html#L19'>recipe</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#L185'>end</a><span class="Delimiter">();</span> +<span id="L73" class="LineNr"> 73 </span> <span class="Conceal">¦</span> Recipe<span class="Delimiter">.</span>erase<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> result<span class="Delimiter">.</span>name<span class="Delimiter">));</span> <span id="L74" class="LineNr"> 74 </span> <span class="Delimiter">}</span> <span id="L75" class="LineNr"> 75 </span> <a href='011load.cc.html#L81'>slurp_body</a><span class="Delimiter">(</span>in<span class="Delimiter">,</span> result<span class="Delimiter">);</span> <span id="L76" class="LineNr"> 76 </span> <span class="Comment">// End Recipe Body(result)</span> @@ -144,14 +145,14 @@ if ('onhashchange' in window) { <span id="L82" class="LineNr"> 82 </span> in >> std::noskipws<span class="Delimiter">;</span> <span id="L83" class="LineNr"> 83 </span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L84" class="LineNr"> 84 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>in<span class="Delimiter">.</span>get<span class="Delimiter">()</span> != <span class="Constant">'['</span><span class="Delimiter">)</span> -<span id="L85" class="LineNr"> 85 </span> <a href='003trace.cc.html#L168'>raise</a> << result<span class="Delimiter">.</span>name << <span class="Constant">": <a href='010vm.cc.html#L19'>recipe</a> body must begin with '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L85" class="LineNr"> 85 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << result<span class="Delimiter">.</span>name << <span class="Constant">": <a href='010vm.cc.html#L19'>recipe</a> body must begin with '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L86" class="LineNr"> 86 </span> <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span class="Comment">// permit trailing comment after '['</span> <span id="L87" class="LineNr"> 87 </span> <a href='010vm.cc.html#L32'>instruction</a> curr<span class="Delimiter">;</span> <span id="L88" class="LineNr"> 88 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='011load.cc.html#L96'>next_instruction</a><span class="Delimiter">(</span>in<span class="Delimiter">,</span> &curr<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L89" class="LineNr"> 89 </span> curr<span class="Delimiter">.</span>original_string = to_original_string<span class="Delimiter">(</span>curr<span class="Delimiter">);</span> -<span id="L90" class="LineNr"> 90 </span> <span class="Comment">// End Rewrite Instruction(curr, recipe result)</span> -<span id="L91" class="LineNr"> 91 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9992</span><span class="Delimiter">,</span> <span class="Constant">"load"</span><span class="Delimiter">)</span> << <span class="Constant">"after rewriting: "</span> << <a href='028call_return.cc.html#L158'>to_string</a><span class="Delimiter">(</span>curr<span class="Delimiter">)</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L92" class="LineNr"> 92 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!curr<span class="Delimiter">.</span>is_empty<span class="Delimiter">())</span> result<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>curr<span class="Delimiter">);</span> +<span id="L89" class="LineNr"> 89 </span> <span class="Conceal">¦</span> curr<span class="Delimiter">.</span>original_string = to_original_string<span class="Delimiter">(</span>curr<span class="Delimiter">);</span> +<span id="L90" class="LineNr"> 90 </span> <span class="Conceal">¦</span> <span class="Comment">// End Rewrite Instruction(curr, recipe result)</span> +<span id="L91" class="LineNr"> 91 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9992</span><span class="Delimiter">,</span> <span class="Constant">"load"</span><span class="Delimiter">)</span> << <span class="Constant">"after rewriting: "</span> << <a href='028call_return.cc.html#L158'>to_string</a><span class="Delimiter">(</span>curr<span class="Delimiter">)</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L92" class="LineNr"> 92 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!curr<span class="Delimiter">.</span>is_empty<span class="Delimiter">())</span> result<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>curr<span class="Delimiter">);</span> <span id="L93" class="LineNr"> 93 </span> <span class="Delimiter">}</span> <span id="L94" class="LineNr"> 94 </span><span class="Delimiter">}</span> <span id="L95" class="LineNr"> 95 </span> @@ -159,67 +160,67 @@ if ('onhashchange' in window) { <span id="L97" class="LineNr"> 97 </span> curr<span class="Delimiter">-></span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span> <span id="L98" class="LineNr"> 98 </span> <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L99" class="LineNr"> 99 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L100" class="LineNr">100 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"incomplete <a href='010vm.cc.html#L19'>recipe</a> at <a href='003trace.cc.html#L185'>end</a> of file (0)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L101" class="LineNr">101 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L100" class="LineNr">100 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"incomplete <a href='010vm.cc.html#L19'>recipe</a> at <a href='003trace.cc.html#L185'>end</a> of file (0)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L101" class="LineNr">101 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L102" class="LineNr">102 </span> <span class="Delimiter">}</span> <span id="L103" class="LineNr">103 </span> <span id="L104" class="LineNr">104 </span> vector<string> words<span class="Delimiter">;</span> <span id="L105" class="LineNr">105 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>in<span class="Delimiter">)</span> && in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L106" class="LineNr">106 </span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L107" class="LineNr">107 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L108" class="LineNr">108 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"incomplete <a href='010vm.cc.html#L19'>recipe</a> at <a href='003trace.cc.html#L185'>end</a> of file (1)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L109" class="LineNr">109 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> -<span id="L110" class="LineNr">110 </span> <span class="Delimiter">}</span> -<span id="L111" class="LineNr">111 </span> string word = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L112" class="LineNr">112 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>word<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> -<span id="L113" class="LineNr">113 </span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> -<span id="L114" class="LineNr">114 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"incomplete <a href='010vm.cc.html#L19'>recipe</a> at <a href='003trace.cc.html#L185'>end</a> of file (2)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L115" class="LineNr">115 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> -<span id="L116" class="LineNr">116 </span> <span class="Delimiter">}</span> -<span id="L117" class="LineNr">117 </span> words<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>word<span class="Delimiter">);</span> -<span id="L118" class="LineNr">118 </span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L106" class="LineNr">106 </span> <span class="Conceal">¦</span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L107" class="LineNr">107 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L108" class="LineNr">108 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"incomplete <a href='010vm.cc.html#L19'>recipe</a> at <a href='003trace.cc.html#L185'>end</a> of file (1)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L109" class="LineNr">109 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L110" class="LineNr">110 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L111" class="LineNr">111 </span> <span class="Conceal">¦</span> string word = <a href='011load.cc.html#L167'>next_word</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L112" class="LineNr">112 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>word<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> +<span id="L113" class="LineNr">113 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> +<span id="L114" class="LineNr">114 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"incomplete <a href='010vm.cc.html#L19'>recipe</a> at <a href='003trace.cc.html#L185'>end</a> of file (2)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L115" class="LineNr">115 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L116" class="LineNr">116 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L117" class="LineNr">117 </span> <span class="Conceal">¦</span> words<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>word<span class="Delimiter">);</span> +<span id="L118" class="LineNr">118 </span> <span class="Conceal">¦</span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L119" class="LineNr">119 </span> <span class="Delimiter">}</span> <span id="L120" class="LineNr">120 </span> <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L121" class="LineNr">121 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>words<span class="Delimiter">)</span> == <span class="Constant">1</span> && words<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> == <span class="Constant">"]"</span><span class="Delimiter">)</span> -<span id="L122" class="LineNr">122 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="Comment">// end of recipe</span> +<span id="L122" class="LineNr">122 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="Comment">// end of recipe</span> <span id="L123" class="LineNr">123 </span> <span id="L124" class="LineNr">124 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>words<span class="Delimiter">)</span> == <span class="Constant">1</span> && <a href='011load.cc.html#L179'>is_label_word</a><span class="Delimiter">(</span>words<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)))</span> <span class="Delimiter">{</span> -<span id="L125" class="LineNr">125 </span> curr<span class="Delimiter">-></span>is_label = <span class="Constant">true</span><span class="Delimiter">;</span> -<span id="L126" class="LineNr">126 </span> curr<span class="Delimiter">-></span>label = words<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> -<span id="L127" class="LineNr">127 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">"label: "</span> << curr<span class="Delimiter">-></span>label << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L128" class="LineNr">128 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L129" class="LineNr">129 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"incomplete <a href='010vm.cc.html#L19'>recipe</a> at <a href='003trace.cc.html#L185'>end</a> of file (3)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L130" class="LineNr">130 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> -<span id="L131" class="LineNr">131 </span> <span class="Delimiter">}</span> -<span id="L132" class="LineNr">132 </span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> +<span id="L125" class="LineNr">125 </span> <span class="Conceal">¦</span> curr<span class="Delimiter">-></span>is_label = <span class="Constant">true</span><span class="Delimiter">;</span> +<span id="L126" class="LineNr">126 </span> <span class="Conceal">¦</span> curr<span class="Delimiter">-></span>label = words<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> +<span id="L127" class="LineNr">127 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">"label: "</span> << curr<span class="Delimiter">-></span>label << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L128" class="LineNr">128 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L129" class="LineNr">129 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"incomplete <a href='010vm.cc.html#L19'>recipe</a> at <a href='003trace.cc.html#L185'>end</a> of file (3)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L130" class="LineNr">130 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L131" class="LineNr">131 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L132" class="LineNr">132 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L133" class="LineNr">133 </span> <span class="Delimiter">}</span> <span id="L134" class="LineNr">134 </span> <span id="L135" class="LineNr">135 </span> vector<string>::iterator p = words<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> <span id="L136" class="LineNr">136 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>find<span class="Delimiter">(</span>words<span class="Delimiter">.</span>begin<span class="Delimiter">(),</span> words<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">(),</span> <span class="Constant">"<-"</span><span class="Delimiter">)</span> != words<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> <span class="Delimiter">{</span> -<span id="L137" class="LineNr">137 </span> <span class="Normal">for</span> <span class="Delimiter">(;</span> *p != <span class="Constant">"<-"</span><span class="Delimiter">;</span> ++p<span class="Delimiter">)</span> -<span id="L138" class="LineNr">138 </span> curr<span class="Delimiter">-></span>products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> -<span id="L139" class="LineNr">139 </span> ++p<span class="Delimiter">;</span> <span class="Comment">// skip <-</span> +<span id="L137" class="LineNr">137 </span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(;</span> *p != <span class="Constant">"<-"</span><span class="Delimiter">;</span> ++p<span class="Delimiter">)</span> +<span id="L138" class="LineNr">138 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> curr<span class="Delimiter">-></span>products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> +<span id="L139" class="LineNr">139 </span> <span class="Conceal">¦</span> ++p<span class="Delimiter">;</span> <span class="Comment">// skip <-</span> <span id="L140" class="LineNr">140 </span> <span class="Delimiter">}</span> <span id="L141" class="LineNr">141 </span> <span id="L142" class="LineNr">142 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>p == words<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> <span class="Delimiter">{</span> -<span id="L143" class="LineNr">143 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"instruction prematurely ended with '<-'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L144" class="LineNr">144 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L143" class="LineNr">143 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"instruction prematurely ended with '<-'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L144" class="LineNr">144 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L145" class="LineNr">145 </span> <span class="Delimiter">}</span> <span id="L146" class="LineNr">146 </span> curr<span class="Delimiter">-></span>name = *p<span class="Delimiter">;</span> ++p<span class="Delimiter">;</span> <span id="L147" class="LineNr">147 </span> <span class="Comment">// curr->operation will be set at transform time</span> <span id="L148" class="LineNr">148 </span> <span id="L149" class="LineNr">149 </span> <span class="Normal">for</span> <span class="Delimiter">(;</span> p != words<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> -<span id="L150" class="LineNr">150 </span> curr<span class="Delimiter">-></span>ingredients<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> +<span id="L150" class="LineNr">150 </span> <span class="Conceal">¦</span> curr<span class="Delimiter">-></span>ingredients<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> <span id="L151" class="LineNr">151 </span> <span id="L152" class="LineNr">152 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">"instruction: "</span> << curr<span class="Delimiter">-></span>name << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L153" class="LineNr">153 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">" number of ingredients: "</span> << <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>curr<span class="Delimiter">-></span>ingredients<span class="Delimiter">)</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L154" class="LineNr">154 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<reagent>::iterator p = curr<span class="Delimiter">-></span>ingredients<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != curr<span class="Delimiter">-></span>ingredients<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> -<span id="L155" class="LineNr">155 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">" ingredient: "</span> << <a href='028call_return.cc.html#L158'>to_string</a><span class="Delimiter">(</span>*p<span class="Delimiter">)</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L155" class="LineNr">155 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">" ingredient: "</span> << <a href='028call_return.cc.html#L158'>to_string</a><span class="Delimiter">(</span>*p<span class="Delimiter">)</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L156" class="LineNr">156 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>vector<reagent>::iterator p = curr<span class="Delimiter">-></span>products<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != curr<span class="Delimiter">-></span>products<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> -<span id="L157" class="LineNr">157 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">" product: "</span> << <a href='028call_return.cc.html#L158'>to_string</a><span class="Delimiter">(</span>*p<span class="Delimiter">)</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L157" class="LineNr">157 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9993</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">" product: "</span> << <a href='028call_return.cc.html#L158'>to_string</a><span class="Delimiter">(</span>*p<span class="Delimiter">)</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L158" class="LineNr">158 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L159" class="LineNr">159 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"9: unbalanced '[' for <a href='010vm.cc.html#L19'>recipe</a></span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L160" class="LineNr">160 </span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span id="L159" class="LineNr">159 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"9: unbalanced '[' for <a href='010vm.cc.html#L19'>recipe</a></span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L160" class="LineNr">160 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span id="L161" class="LineNr">161 </span> <span class="Delimiter">}</span> <span id="L162" class="LineNr">162 </span> <span class="Comment">// End next_instruction(curr)</span> <span id="L163" class="LineNr">163 </span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> @@ -234,7 +235,7 @@ if ('onhashchange' in window) { <span id="L172" class="LineNr">172 </span> <a href='011load.cc.html#L220'>skip_whitespace_and_comments_but_not_newline</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span id="L173" class="LineNr">173 </span> string result = out<span class="Delimiter">.</span>str<span class="Delimiter">();</span> <span id="L174" class="LineNr">174 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>result != <span class="Constant">"["</span> && <a href='011load.cc.html#L184'>ends_with</a><span class="Delimiter">(</span>result<span class="Delimiter">,</span> <span class="Constant">'['</span><span class="Delimiter">))</span> -<span id="L175" class="LineNr">175 </span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"insert a space before '[' in '"</span> << result << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> +<span id="L175" class="LineNr">175 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <span class="Constant">"insert a space before '[' in '"</span> << result << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L176" class="LineNr">176 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span id="L177" class="LineNr">177 </span><span class="Delimiter">}</span> <span id="L178" class="LineNr">178 </span> @@ -255,45 +256,45 @@ if ('onhashchange' in window) { <span id="L193" class="LineNr">193 </span><span class="Normal">void</span> <a href='011load.cc.html#L193'>slurp_word</a><span class="Delimiter">(</span>istream& in<span class="Delimiter">,</span> ostream& out<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L194" class="LineNr">194 </span> <span class="Normal">char</span> c<span class="Delimiter">;</span> <span id="L195" class="LineNr">195 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>in<span class="Delimiter">)</span> && Terminators<span class="Delimiter">.</span>find<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">())</span> != string::npos<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L196" class="LineNr">196 </span> in >> c<span class="Delimiter">;</span> -<span id="L197" class="LineNr">197 </span> out << c<span class="Delimiter">;</span> -<span id="L198" class="LineNr">198 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> +<span id="L196" class="LineNr">196 </span> <span class="Conceal">¦</span> in >> c<span class="Delimiter">;</span> +<span id="L197" class="LineNr">197 </span> <span class="Conceal">¦</span> out << c<span class="Delimiter">;</span> +<span id="L198" class="LineNr">198 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L199" class="LineNr">199 </span> <span class="Delimiter">}</span> <span id="L200" class="LineNr">200 </span> <span class="Normal">while</span> <span class="Delimiter">(</span>in >> c<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L201" class="LineNr">201 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>isspace<span class="Delimiter">(</span>c<span class="Delimiter">)</span> || Terminators<span class="Delimiter">.</span>find<span class="Delimiter">(</span>c<span class="Delimiter">)</span> != string::npos || Ignore<span class="Delimiter">.</span>find<span class="Delimiter">(</span>c<span class="Delimiter">)</span> != string::npos<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L202" class="LineNr">202 </span> in<span class="Delimiter">.</span>putback<span class="Delimiter">(</span>c<span class="Delimiter">);</span> -<span id="L203" class="LineNr">203 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> -<span id="L204" class="LineNr">204 </span> <span class="Delimiter">}</span> -<span id="L205" class="LineNr">205 </span> out << c<span class="Delimiter">;</span> +<span id="L201" class="LineNr">201 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>isspace<span class="Delimiter">(</span>c<span class="Delimiter">)</span> || Terminators<span class="Delimiter">.</span>find<span class="Delimiter">(</span>c<span class="Delimiter">)</span> != string::npos || Ignore<span class="Delimiter">.</span>find<span class="Delimiter">(</span>c<span class="Delimiter">)</span> != string::npos<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L202" class="LineNr">202 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> in<span class="Delimiter">.</span>putback<span class="Delimiter">(</span>c<span class="Delimiter">);</span> +<span id="L203" class="LineNr">203 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span> +<span id="L204" class="LineNr">204 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> +<span id="L205" class="LineNr">205 </span> <span class="Conceal">¦</span> out << c<span class="Delimiter">;</span> <span id="L206" class="LineNr">206 </span> <span class="Delimiter">}</span> <span id="L207" class="LineNr">207 </span><span class="Delimiter">}</span> <span id="L208" class="LineNr">208 </span> <span id="L209" class="LineNr">209 </span><span class="Normal">void</span> <a href='011load.cc.html#L209'>skip_whitespace_and_comments</a><span class="Delimiter">(</span>istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L210" class="LineNr">210 </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="L211" class="LineNr">211 </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="L212" class="LineNr">212 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>isspace<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()))</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> -<span id="L213" class="LineNr">213 </span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>Ignore<span class="Delimiter">.</span>find<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">())</span> != string::npos<span class="Delimiter">)</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> -<span id="L214" class="LineNr">214 </span> <span class="Normal">else</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> <a href='011load.cc.html#L231'>skip_comment</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L215" class="LineNr">215 </span> <span class="Normal">else</span> <span class="Identifier">break</span><span class="Delimiter">;</span> +<span id="L211" class="LineNr">211 </span> <span class="Conceal">¦</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="L212" class="LineNr">212 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>isspace<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()))</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> +<span id="L213" class="LineNr">213 </span> <span class="Conceal">¦</span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>Ignore<span class="Delimiter">.</span>find<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">())</span> != string::npos<span class="Delimiter">)</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> +<span id="L214" class="LineNr">214 </span> <span class="Conceal">¦</span> <span class="Normal">else</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> <a href='011load.cc.html#L231'>skip_comment</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L215" class="LineNr">215 </span> <span class="Conceal">¦</span> <span class="Normal">else</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L216" class="LineNr">216 </span> <span class="Delimiter">}</span> <span id="L217" class="LineNr">217 </span><span class="Delimiter">}</span> <span id="L218" class="LineNr">218 </span> <span id="L219" class="LineNr">219 </span><span class="Comment">// confusing; move to the next line only to skip a comment, but never otherwise</span> <span id="L220" class="LineNr">220 </span><span class="Normal">void</span> <a href='011load.cc.html#L220'>skip_whitespace_and_comments_but_not_newline</a><span class="Delimiter">(</span>istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L221" class="LineNr">221 </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="L222" class="LineNr">222 </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="L223" class="LineNr">223 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> == <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> -<span id="L224" class="LineNr">224 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>isspace<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()))</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> -<span id="L225" class="LineNr">225 </span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>Ignore<span class="Delimiter">.</span>find<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">())</span> != string::npos<span class="Delimiter">)</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> -<span id="L226" class="LineNr">226 </span> <span class="Normal">else</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> <a href='011load.cc.html#L231'>skip_comment</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> -<span id="L227" class="LineNr">227 </span> <span class="Normal">else</span> <span class="Identifier">break</span><span class="Delimiter">;</span> +<span id="L222" class="LineNr">222 </span> <span class="Conceal">¦</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="L223" class="LineNr">223 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> == <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> +<span id="L224" class="LineNr">224 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>isspace<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()))</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> +<span id="L225" class="LineNr">225 </span> <span class="Conceal">¦</span> <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>Ignore<span class="Delimiter">.</span>find<span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">())</span> != string::npos<span class="Delimiter">)</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> +<span id="L226" class="LineNr">226 </span> <span class="Conceal">¦</span> <span class="Normal">else</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> <a href='011load.cc.html#L231'>skip_comment</a><span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span id="L227" class="LineNr">227 </span> <span class="Conceal">¦</span> <span class="Normal">else</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L228" class="LineNr">228 </span> <span class="Delimiter">}</span> <span id="L229" class="LineNr">229 </span><span class="Delimiter">}</span> <span id="L230" class="LineNr">230 </span> <span id="L231" class="LineNr">231 </span><span class="Normal">void</span> <a href='011load.cc.html#L231'>skip_comment</a><span class="Delimiter">(</span>istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L232" class="LineNr">232 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>in<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="L233" class="LineNr">233 </span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> -<span id="L234" class="LineNr">234 </span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>in<span class="Delimiter">)</span> && in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> +<span id="L233" class="LineNr">233 </span> <span class="Conceal">¦</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> +<span id="L234" class="LineNr">234 </span> <span class="Conceal">¦</span> <span class="Normal">while</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>in<span class="Delimiter">)</span> && in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> <span id="L235" class="LineNr">235 </span> <span class="Delimiter">}</span> <span id="L236" class="LineNr">236 </span><span class="Delimiter">}</span> <span id="L237" class="LineNr">237 </span> @@ -416,9 +417,9 @@ if ('onhashchange' in window) { <span id="L354" class="LineNr">354 </span><span class="Delimiter">:(code)</span> <span id="L355" class="LineNr">355 </span><span class="Normal">void</span> <a href='011load.cc.html#L355'>test_parse_comment_terminated_by_eof</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> <span id="L356" class="LineNr">356 </span> load<span class="Delimiter">(</span><span class="Constant">"recipe <a href='000organization.cc.html#L113'>main</a> [</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L357" class="LineNr">357 </span> <span class="Constant">" a:number <- copy 34</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L358" class="LineNr">358 </span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L359" class="LineNr">359 </span> <span class="Constant">"# abc"</span><span class="Delimiter">);</span> <span class="Comment">// no newline after comment</span> +<span id="L357" class="LineNr">357 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span><span class="Constant">" a:number <- copy 34</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L358" class="LineNr">358 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span><span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L359" class="LineNr">359 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span><span class="Constant">"# abc"</span><span class="Delimiter">);</span> <span class="Comment">// no newline after comment</span> <span id="L360" class="LineNr">360 </span> cerr << <span class="Constant">"."</span><span class="Delimiter">;</span> <span class="Comment">// termination = success</span> <span id="L361" class="LineNr">361 </span><span class="Delimiter">}</span> <span id="L362" class="LineNr">362 </span> @@ -468,7 +469,7 @@ if ('onhashchange' in window) { <span id="L406" class="LineNr">406 </span> cerr << <span class="Constant">'^'</span><span class="Delimiter">;</span> <span id="L407" class="LineNr">407 </span> <span class="Normal">char</span> c<span class="Delimiter">;</span> <span id="L408" class="LineNr">408 </span> <span class="Normal">while</span> <span class="Delimiter">(</span>in >> c<span class="Delimiter">)</span> -<span id="L409" class="LineNr">409 </span> cerr << c<span class="Delimiter">;</span> +<span id="L409" class="LineNr">409 </span> <span class="Conceal">¦</span> cerr << c<span class="Delimiter">;</span> <span id="L410" class="LineNr">410 </span> cerr << <span class="Constant">"$</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">;</span> <span id="L411" class="LineNr">411 </span> exit<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L412" class="LineNr">412 </span><span class="Delimiter">}</span> |