diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-03-02 05:48:01 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-03-02 05:48:01 -0800 |
commit | fd7d8138a4ff5515f9b79c584a98d5c26d8ddb8a (patch) | |
tree | ea6e8e1c988a67e302d9f6abe6fda46e1648dc72 /html/057immutable.cc.html | |
parent | a802f0cedc7b5580d746f46ae62fcf8074ae3c49 (diff) | |
download | mu-fd7d8138a4ff5515f9b79c584a98d5c26d8ddb8a.tar.gz |
3750
Diffstat (limited to 'html/057immutable.cc.html')
-rw-r--r-- | html/057immutable.cc.html | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/html/057immutable.cc.html b/html/057immutable.cc.html index 8157d755..99147f16 100644 --- a/html/057immutable.cc.html +++ b/html/057immutable.cc.html @@ -406,7 +406,7 @@ if ('onhashchange' in window) { <span id="L344" class="LineNr">344 </span> <span class="Comment">// b) we never call 'put' or 'put-index' on it, and</span> <span id="L345" class="LineNr">345 </span> <span class="Comment">// c) any non-primitive recipe calls in the body aren't returning it as a product</span> <span id="L346" class="LineNr">346 </span> <span class="Normal">const</span> recipe& caller = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">);</span> -<span id="L347" class="LineNr">347 </span> <a href='003trace.cc.html#L169'>trace</a><span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"--- check mutability of ingredients in <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L347" class="LineNr">347 </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">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"--- check mutability of ingredients in <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L348" class="LineNr">348 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!caller<span class="Delimiter">.</span>has_header<span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// skip check for old-style recipes calling next-ingredient directly</span> <span id="L349" class="LineNr">349 </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>caller<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L350" class="LineNr">350 </span> <span class="Normal">const</span> reagent& current_ingredient = caller<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> @@ -429,7 +429,7 @@ if ('onhashchange' in window) { <span id="L367" class="LineNr">367 </span> <span class="Comment">// primitive recipe</span> <span id="L368" class="LineNr">368 </span> <span class="Normal">switch</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>operation<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L369" class="LineNr">369 </span> <span class="Normal">case</span> <a href='010vm.cc.html#L189'>COPY</a>: -<span id="L370" class="LineNr">370 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = current_ingredient_indices<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != current_ingredient_indices<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> +<span id="L370" class="LineNr">370 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = current_ingredient_indices<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != current_ingredient_indices<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span id="L371" class="LineNr">371 </span> current_ingredient_and_aliases<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>*p<span class="Delimiter">).</span>name<span class="Delimiter">);</span> <span id="L372" class="LineNr">372 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L373" class="LineNr">373 </span> <span class="Normal">case</span> GET: @@ -447,7 +447,7 @@ if ('onhashchange' in window) { <span id="L385" class="LineNr">385 </span> <span class="Normal">else</span> <span class="Delimiter">{</span> <span id="L386" class="LineNr">386 </span> <span class="Comment">// defined recipe</span> <span id="L387" class="LineNr">387 </span> set<<span class="Normal">int</span>> contained_in_product_indices = <a href='057immutable.cc.html#L395'>scan_contained_in_product_indices</a><span class="Delimiter">(</span>inst<span class="Delimiter">,</span> current_ingredient_indices<span class="Delimiter">);</span> -<span id="L388" class="LineNr">388 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = contained_in_product_indices<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != contained_in_product_indices<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L388" class="LineNr">388 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = contained_in_product_indices<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != contained_in_product_indices<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L389" class="LineNr">389 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>*p < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">))</span> <span id="L390" class="LineNr">390 </span> current_ingredient_and_aliases<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> <span id="L391" class="LineNr">391 </span> <span class="Delimiter">}</span> @@ -457,7 +457,7 @@ if ('onhashchange' in window) { <span id="L395" class="LineNr">395 </span>set<<span class="Normal">int</span>> <a href='057immutable.cc.html#L395'>scan_contained_in_product_indices</a><span class="Delimiter">(</span><span class="Normal">const</span> instruction& inst<span class="Delimiter">,</span> set<<span class="Normal">int</span>>& <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L396" class="LineNr">396 </span> set<reagent> selected_ingredients<span class="Delimiter">;</span> <span id="L397" class="LineNr">397 </span> <span class="Normal">const</span> recipe& callee = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> inst<span class="Delimiter">.</span>operation<span class="Delimiter">);</span> -<span id="L398" class="LineNr">398 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L398" class="LineNr">398 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L399" class="LineNr">399 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>*p >= <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// optional immutable ingredient</span> <span id="L400" class="LineNr">400 </span> selected_ingredients<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> <span id="L401" class="LineNr">401 </span> <span class="Delimiter">}</span> @@ -465,7 +465,7 @@ if ('onhashchange' in window) { <span id="L403" class="LineNr">403 </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>callee<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L404" class="LineNr">404 </span> <span class="Normal">const</span> reagent& current_product = callee<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L405" class="LineNr">405 </span> <span class="Normal">const</span> string_tree* contained_in_name = property<span class="Delimiter">(</span>current_product<span class="Delimiter">,</span> <span class="Constant">"contained-in"</span><span class="Delimiter">);</span> -<span id="L406" class="LineNr">406 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>contained_in_name && selected_ingredients<span class="Delimiter">.</span>find<span class="Delimiter">(</span>contained_in_name<span class="Delimiter">-></span>value<span class="Delimiter">)</span> != selected_ingredients<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">())</span> +<span id="L406" class="LineNr">406 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>contained_in_name && selected_ingredients<span class="Delimiter">.</span>find<span class="Delimiter">(</span>contained_in_name<span class="Delimiter">-></span>value<span class="Delimiter">)</span> != selected_ingredients<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> <span id="L407" class="LineNr">407 </span> result<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L408" class="LineNr">408 </span> <span class="Delimiter">}</span> <span id="L409" class="LineNr">409 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> @@ -501,19 +501,19 @@ if ('onhashchange' in window) { <span id="L439" class="LineNr">439 </span> <span class="Comment">// first check if the instruction is directly modifying something it shouldn't</span> <span id="L440" class="LineNr">440 </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>inst<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L441" class="LineNr">441 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>has_property<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">),</span> <span class="Constant">"lookup"</span><span class="Delimiter">)</span> -<span id="L442" class="LineNr">442 </span> && current_ingredient_and_aliases<span class="Delimiter">.</span>find<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> != current_ingredient_and_aliases<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">())</span> <span class="Delimiter">{</span> +<span id="L442" class="LineNr">442 </span> && current_ingredient_and_aliases<span class="Delimiter">.</span>find<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> != current_ingredient_and_aliases<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L443" class="LineNr">443 </span> string current_product_name = inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name<span class="Delimiter">;</span> <span id="L444" class="LineNr">444 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>current_product_name == original_ingredient_name<span class="Delimiter">)</span> -<span id="L445" class="LineNr">445 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_product_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because it's an ingredient of recipe "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L445" class="LineNr">445 </span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_product_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because it's an ingredient of recipe "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L446" class="LineNr">446 </span> <span class="Normal">else</span> -<span id="L447" class="LineNr">447 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_product_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because that would modify "</span> << original_ingredient_name << <span class="Constant">" which is an ingredient of <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L447" class="LineNr">447 </span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_product_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because that would modify "</span> << original_ingredient_name << <span class="Constant">" which is an ingredient of <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L448" class="LineNr">448 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span id="L449" class="LineNr">449 </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="Comment">// check if there's any indirect modification going on</span> <span id="L452" class="LineNr">452 </span> set<<span class="Normal">int</span>> current_ingredient_indices = <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">(</span>inst<span class="Delimiter">,</span> current_ingredient_and_aliases<span class="Delimiter">);</span> <span id="L453" class="LineNr">453 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>current_ingredient_indices<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// ingredient not found in call</span> -<span id="L454" class="LineNr">454 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = current_ingredient_indices<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != current_ingredient_indices<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L454" class="LineNr">454 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = current_ingredient_indices<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != current_ingredient_indices<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L455" class="LineNr">455 </span> <span class="Normal">const</span> <span class="Normal">int</span> current_ingredient_index = *p<span class="Delimiter">;</span> <span id="L456" class="LineNr">456 </span> reagent current_ingredient = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>current_ingredient_index<span class="Delimiter">);</span> <span id="L457" class="LineNr">457 </span> canonize_type<span class="Delimiter">(</span>current_ingredient<span class="Delimiter">);</span> @@ -527,9 +527,9 @@ if ('onhashchange' in window) { <span id="L465" class="LineNr">465 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>operation == PUT || inst<span class="Delimiter">.</span>operation == PUT_INDEX<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L466" class="LineNr">466 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>current_ingredient_index == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L467" class="LineNr">467 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>current_ingredient_name == original_ingredient_name<span class="Delimiter">)</span> -<span id="L468" class="LineNr">468 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_ingredient_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because it's an ingredient of recipe "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L468" class="LineNr">468 </span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_ingredient_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because it's an ingredient of recipe "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L469" class="LineNr">469 </span> <span class="Normal">else</span> -<span id="L470" class="LineNr">470 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_ingredient_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because that would modify '"</span> << original_ingredient_name << <span class="Constant">"' which is an ingredient of <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L470" class="LineNr">470 </span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_ingredient_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because that would modify '"</span> << original_ingredient_name << <span class="Constant">"' which is an ingredient of <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L471" class="LineNr">471 </span> <span class="Delimiter">}</span> <span id="L472" class="LineNr">472 </span> <span class="Delimiter">}</span> <span id="L473" class="LineNr">473 </span> <span class="Delimiter">}</span> @@ -537,9 +537,9 @@ if ('onhashchange' in window) { <span id="L475" class="LineNr">475 </span> <span class="Comment">// defined recipe</span> <span id="L476" class="LineNr">476 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='057immutable.cc.html#L486'>is_modified_in_recipe</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>operation<span class="Delimiter">,</span> current_ingredient_index<span class="Delimiter">,</span> caller<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span id="L477" class="LineNr">477 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>current_ingredient_name == original_ingredient_name<span class="Delimiter">)</span> -<span id="L478" class="LineNr">478 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_ingredient_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because it's an ingredient of recipe "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</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#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_ingredient_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because it's an ingredient of recipe "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L479" class="LineNr">479 </span> <span class="Normal">else</span> -<span id="L480" class="LineNr">480 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_ingredient_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because that would modify '"</span> << original_ingredient_name << <span class="Constant">"' which is an ingredient of <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L480" class="LineNr">480 </span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"cannot modify '"</span> << current_ingredient_name << <span class="Constant">"' in <a href='010vm.cc.html#L32'>instruction</a> '"</span> << inst<span class="Delimiter">.</span>original_string << <span class="Constant">"' because that would modify '"</span> << original_ingredient_name << <span class="Constant">"' which is an ingredient of <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <span class="Constant">" but not also a product</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L481" class="LineNr">481 </span> <span class="Delimiter">}</span> <span id="L482" class="LineNr">482 </span> <span class="Delimiter">}</span> <span id="L483" class="LineNr">483 </span> <span class="Delimiter">}</span> @@ -548,7 +548,7 @@ if ('onhashchange' in window) { <span id="L486" class="LineNr">486 </span><span class="Normal">bool</span> <a href='057immutable.cc.html#L486'>is_modified_in_recipe</a><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="Normal">const</span> <span class="Normal">int</span> ingredient_index<span class="Delimiter">,</span> <span class="Normal">const</span> recipe& caller<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L487" class="LineNr">487 </span> <span class="Normal">const</span> recipe& callee = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">);</span> <span id="L488" class="LineNr">488 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!callee<span class="Delimiter">.</span>has_header<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L489" class="LineNr">489 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"can't check mutability of ingredients in recipe "</span> << callee<span class="Delimiter">.</span>name << <span class="Constant">" because it uses 'next-ingredient' directly, rather than a recipe header.</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L489" class="LineNr">489 </span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"can't check mutability of ingredients in recipe "</span> << callee<span class="Delimiter">.</span>name << <span class="Constant">" because it uses 'next-ingredient' directly, rather than a recipe header.</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L490" class="LineNr">490 </span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L491" class="LineNr">491 </span> <span class="Delimiter">}</span> <span id="L492" class="LineNr">492 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>ingredient_index >= <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="Comment">// optional immutable ingredient</span> @@ -567,7 +567,7 @@ if ('onhashchange' in window) { <span id="L505" class="LineNr">505 </span> set<<span class="Normal">int</span>> result<span class="Delimiter">;</span> <span id="L506" class="LineNr">506 </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>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L507" class="LineNr">507 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> -<span id="L508" class="LineNr">508 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>ingredient_names<span class="Delimiter">.</span>find<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> != ingredient_names<span class="Delimiter">.</span><a href='003trace.cc.html#L193'>end</a><span class="Delimiter">())</span> +<span id="L508" class="LineNr">508 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>ingredient_names<span class="Delimiter">.</span>find<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> != ingredient_names<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> <span id="L509" class="LineNr">509 </span> result<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L510" class="LineNr">510 </span> <span class="Delimiter">}</span> <span id="L511" class="LineNr">511 </span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> @@ -619,7 +619,7 @@ if ('onhashchange' in window) { <span id="L557" class="LineNr">557 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!tmp<span class="Delimiter">-></span>atom <span id="L558" class="LineNr">558 </span> || <span class="Delimiter">(</span>!is_present_in_ingredients<span class="Delimiter">(</span>caller<span class="Delimiter">,</span> tmp<span class="Delimiter">-></span>value<span class="Delimiter">)</span> <span id="L559" class="LineNr">559 </span> && !is_present_in_products<span class="Delimiter">(</span>caller<span class="Delimiter">,</span> tmp<span class="Delimiter">-></span>value<span class="Delimiter">)))</span> <span class="Delimiter">{</span> -<span id="L560" class="LineNr">560 </span> <a href='003trace.cc.html#L176'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"/contained-in can only point to another ingredient or product, but got '"</span> << to_string<span class="Delimiter">(</span>property<span class="Delimiter">(</span>current_ingredient<span class="Delimiter">,</span> <span class="Constant">"contained-in"</span><span class="Delimiter">))</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L193'>end</a><span class="Delimiter">();</span> +<span id="L560" class="LineNr">560 </span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"/contained-in can only point to another ingredient or product, but got '"</span> << to_string<span class="Delimiter">(</span>property<span class="Delimiter">(</span>current_ingredient<span class="Delimiter">,</span> <span class="Constant">"contained-in"</span><span class="Delimiter">))</span> << <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="L561" class="LineNr">561 </span> <span class="Delimiter">}</span> <span id="L562" class="LineNr">562 </span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L563" class="LineNr">563 </span><span class="Delimiter">}</span> |