diff options
Diffstat (limited to 'html/055shape_shifting_container.cc.html')
-rw-r--r-- | html/055shape_shifting_container.cc.html | 282 |
1 files changed, 151 insertions, 131 deletions
diff --git a/html/055shape_shifting_container.cc.html b/html/055shape_shifting_container.cc.html index faac6a05..f01b5d22 100644 --- a/html/055shape_shifting_container.cc.html +++ b/html/055shape_shifting_container.cc.html @@ -683,138 +683,158 @@ if ('onhashchange' in window) { <span id="L617" class="LineNr">617 </span> <span id="L618" class="LineNr">618 </span><span class="Delimiter">:(before "End compute_container_address_offsets Non-atom Special-cases")</span> <span id="L619" class="LineNr">619 </span><span class="Normal">const</span> type_tree* root = get_base_type<span class="Delimiter">(</span>type<span class="Delimiter">);</span> -<span id="L620" class="LineNr">620 </span>type_info& info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> root<span class="Delimiter">-></span>value<span class="Delimiter">);</span> -<span id="L621" class="LineNr">621 </span><span class="Normal">if</span> <span class="Delimiter">(</span>info<span class="Delimiter">.</span>kind == <a href='010vm.cc.html#L173'>CONTAINER</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L622" class="LineNr">622 </span> compute_container_address_offsets<span class="Delimiter">(</span>info<span class="Delimiter">,</span> type<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> -<span id="L623" class="LineNr">623 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> -<span id="L624" class="LineNr">624 </span><span class="Delimiter">}</span> -<span id="L625" class="LineNr">625 </span><span class="Normal">if</span> <span class="Delimiter">(</span>info<span class="Delimiter">.</span>kind == <a href='010vm.cc.html#L174'>EXCLUSIVE_CONTAINER</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L626" class="LineNr">626 </span> <a href='036refcount.cc.html#L367'>compute_exclusive_container_address_offsets</a><span class="Delimiter">(</span>info<span class="Delimiter">,</span> type<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> -<span id="L627" class="LineNr">627 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> -<span id="L628" class="LineNr">628 </span><span class="Delimiter">}</span> -<span id="L629" class="LineNr">629 </span> -<span id="L630" class="LineNr">630 </span><span class="Delimiter">:(before "End Unit Tests")</span> -<span id="L631" class="LineNr">631 </span><span class="Normal">void</span> test_container_address_offsets_in_shape_shifting_container<span class="Delimiter">()</span> <span class="Delimiter">{</span> -<span id="L632" class="LineNr">632 </span> run<span class="Delimiter">(</span><span class="Constant">"container foo:_t [</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L633" class="LineNr">633 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" x:num</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L634" class="LineNr">634 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" y:_t</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L635" class="LineNr">635 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> -<span id="L636" class="LineNr">636 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:foo:&:num"</span><span class="Delimiter">);</span> -<span id="L637" class="LineNr">637 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> -<span id="L638" class="LineNr">638 </span> compute_container_address_offsets<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> -<span id="L639" class="LineNr">639 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> -<span id="L640" class="LineNr">640 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">()));</span> -<span id="L641" class="LineNr">641 </span> set<address_element_info>& offset_info = get<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">());</span> -<span id="L642" class="LineNr">642 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> -<span id="L643" class="LineNr">643 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span>offset<span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">);</span> <span class="Comment">//</span> -<span id="L644" class="LineNr">644 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>atom<span class="Delimiter">);</span> -<span id="L645" class="LineNr">645 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>name<span class="Delimiter">,</span> <span class="Constant">"number"</span><span class="Delimiter">);</span> -<span id="L646" class="LineNr">646 </span><span class="Delimiter">}</span> -<span id="L647" class="LineNr">647 </span> -<span id="L648" class="LineNr">648 </span><span class="Normal">void</span> test_container_address_offsets_in_nested_shape_shifting_container<span class="Delimiter">()</span> <span class="Delimiter">{</span> -<span id="L649" class="LineNr">649 </span> run<span class="Delimiter">(</span><span class="Constant">"container foo:_t [</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L650" class="LineNr">650 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" x:num</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L651" class="LineNr">651 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" y:_t</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L652" class="LineNr">652 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L653" class="LineNr">653 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">"container bar:_t [</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L654" class="LineNr">654 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" x:_t</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L655" class="LineNr">655 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" y:foo:_t</span><span class="cSpecial">\n</span><span class="Constant">"</span> -<span id="L656" class="LineNr">656 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> -<span id="L657" class="LineNr">657 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:bar:&:num"</span><span class="Delimiter">);</span> -<span id="L658" class="LineNr">658 </span> <a href='003trace.cc.html#L158'>CLEAR_TRACE</a><span class="Delimiter">;</span> -<span id="L659" class="LineNr">659 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> -<span id="L660" class="LineNr">660 </span> compute_container_address_offsets<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> -<span id="L661" class="LineNr">661 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> -<span id="L662" class="LineNr">662 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">()));</span> -<span id="L663" class="LineNr">663 </span> set<address_element_info>& offset_info = get<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">());</span> -<span id="L664" class="LineNr">664 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">),</span> <span class="Constant">2</span><span class="Delimiter">);</span> -<span id="L665" class="LineNr">665 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span>offset<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> <span class="Comment">//</span> -<span id="L666" class="LineNr">666 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>atom<span class="Delimiter">);</span> -<span id="L667" class="LineNr">667 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>name<span class="Delimiter">,</span> <span class="Constant">"number"</span><span class="Delimiter">);</span> -<span id="L668" class="LineNr">668 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">((</span>++offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">())-></span>offset<span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">);</span> <span class="Comment">//</span> -<span id="L669" class="LineNr">669 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">((</span>++offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">())-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>atom<span class="Delimiter">);</span> -<span id="L670" class="LineNr">670 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">((</span>++offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">())-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>name<span class="Delimiter">,</span> <span class="Constant">"number"</span><span class="Delimiter">);</span> -<span id="L671" class="LineNr">671 </span><span class="Delimiter">}</span> -<span id="L672" class="LineNr">672 </span> -<span id="L673" class="LineNr">673 </span><span class="SalientComment">//:: 'merge' on shape-shifting containers</span> -<span id="L674" class="LineNr">674 </span> -<span id="L675" class="LineNr">675 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_container_containing_exclusive_container)</span> -<span id="L676" class="LineNr">676 </span><span class="muData">container</span> foo:_elem [ -<span id="L677" class="LineNr">677 </span> <span class="Normal">x</span>:num -<span id="L678" class="LineNr">678 </span> <span class="Normal">y</span>:_elem -<span id="L679" class="LineNr">679 </span>] -<span id="L680" class="LineNr">680 </span><span class="muData">exclusive-container</span> bar [ -<span id="L681" class="LineNr">681 </span> <span class="Normal">x</span>:num -<span id="L682" class="LineNr">682 </span> <span class="Normal">y</span>:num -<span id="L683" class="LineNr">683 </span>] -<span id="L684" class="LineNr">684 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L685" class="LineNr">685 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">23</span><span class="Delimiter">,</span> <span class="Constant">1</span>/y<span class="Delimiter">,</span> <span class="Constant">34</span> -<span id="L686" class="LineNr">686 </span>] -<span id="L687" class="LineNr">687 </span><span class="traceContains">+mem: storing 23 in location 1</span> -<span id="L688" class="LineNr">688 </span><span class="traceContains">+mem: storing 1 in location 2</span> -<span id="L689" class="LineNr">689 </span><span class="traceContains">+mem: storing 34 in location 3</span> -<span id="L690" class="LineNr">690 </span>$error: <span class="Constant">0</span> -<span id="L691" class="LineNr">691 </span> -<span id="L692" class="LineNr">692 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_container_containing_exclusive_container_2)</span> -<span id="L693" class="LineNr">693 </span><span class="Special">% Hide_errors = true;</span> -<span id="L694" class="LineNr">694 </span><span class="muData">container</span> foo:_elem [ -<span id="L695" class="LineNr">695 </span> <span class="Normal">x</span>:num -<span id="L696" class="LineNr">696 </span> <span class="Normal">y</span>:_elem -<span id="L697" class="LineNr">697 </span>] -<span id="L698" class="LineNr">698 </span><span class="muData">exclusive-container</span> bar [ -<span id="L699" class="LineNr">699 </span> <span class="Normal">x</span>:num -<span id="L700" class="LineNr">700 </span> <span class="Normal">y</span>:num -<span id="L701" class="LineNr">701 </span>] -<span id="L702" class="LineNr">702 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L703" class="LineNr">703 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">23</span><span class="Delimiter">,</span> <span class="Constant">1</span>/y<span class="Delimiter">,</span> <span class="Constant">34</span><span class="Delimiter">,</span> <span class="Constant">35</span> -<span id="L704" class="LineNr">704 </span>] -<span id="L705" class="LineNr">705 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: too many ingredients in '1:foo:bar <- merge 23, 1/y, 34, 35'</span> -<span id="L706" class="LineNr">706 </span> -<span id="L707" class="LineNr">707 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_exclusive_container_containing_container)</span> -<span id="L708" class="LineNr">708 </span><span class="muData">exclusive-container</span> foo:_elem [ -<span id="L709" class="LineNr">709 </span> <span class="Normal">x</span>:num -<span id="L710" class="LineNr">710 </span> <span class="Normal">y</span>:_elem -<span id="L711" class="LineNr">711 </span>] -<span id="L712" class="LineNr">712 </span><span class="muData">container</span> bar [ -<span id="L713" class="LineNr">713 </span> <span class="Normal">x</span>:num -<span id="L714" class="LineNr">714 </span> <span class="Normal">y</span>:num -<span id="L715" class="LineNr">715 </span>] -<span id="L716" class="LineNr">716 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L717" class="LineNr">717 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">1</span>/y<span class="Delimiter">,</span> <span class="Constant">23</span><span class="Delimiter">,</span> <span class="Constant">34</span> -<span id="L718" class="LineNr">718 </span>] -<span id="L719" class="LineNr">719 </span><span class="traceContains">+mem: storing 1 in location 1</span> -<span id="L720" class="LineNr">720 </span><span class="traceContains">+mem: storing 23 in location 2</span> -<span id="L721" class="LineNr">721 </span><span class="traceContains">+mem: storing 34 in location 3</span> -<span id="L722" class="LineNr">722 </span>$error: <span class="Constant">0</span> -<span id="L723" class="LineNr">723 </span> -<span id="L724" class="LineNr">724 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_exclusive_container_containing_container_2)</span> -<span id="L725" class="LineNr">725 </span><span class="muData">exclusive-container</span> foo:_elem [ -<span id="L726" class="LineNr">726 </span> <span class="Normal">x</span>:num -<span id="L727" class="LineNr">727 </span> <span class="Normal">y</span>:_elem -<span id="L728" class="LineNr">728 </span>] -<span id="L729" class="LineNr">729 </span><span class="muData">container</span> bar [ -<span id="L730" class="LineNr">730 </span> <span class="Normal">x</span>:num -<span id="L731" class="LineNr">731 </span> <span class="Normal">y</span>:num -<span id="L732" class="LineNr">732 </span>] -<span id="L733" class="LineNr">733 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L734" class="LineNr">734 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">0</span>/x<span class="Delimiter">,</span> <span class="Constant">23</span> +<span id="L620" class="LineNr">620 </span><span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> root<span class="Delimiter">-></span>value<span class="Delimiter">))</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// error raised elsewhere</span> +<span id="L621" class="LineNr">621 </span>type_info& info = get<span class="Delimiter">(</span>Type<span class="Delimiter">,</span> root<span class="Delimiter">-></span>value<span class="Delimiter">);</span> +<span id="L622" class="LineNr">622 </span><span class="Normal">if</span> <span class="Delimiter">(</span>info<span class="Delimiter">.</span>kind == <a href='010vm.cc.html#L173'>CONTAINER</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L623" class="LineNr">623 </span> compute_container_address_offsets<span class="Delimiter">(</span>info<span class="Delimiter">,</span> type<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> +<span id="L624" class="LineNr">624 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> +<span id="L625" class="LineNr">625 </span><span class="Delimiter">}</span> +<span id="L626" class="LineNr">626 </span><span class="Normal">if</span> <span class="Delimiter">(</span>info<span class="Delimiter">.</span>kind == <a href='010vm.cc.html#L174'>EXCLUSIVE_CONTAINER</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L627" class="LineNr">627 </span> <a href='036refcount.cc.html#L367'>compute_exclusive_container_address_offsets</a><span class="Delimiter">(</span>info<span class="Delimiter">,</span> type<span class="Delimiter">,</span> location_for_error_messages<span class="Delimiter">);</span> +<span id="L628" class="LineNr">628 </span> <span class="Identifier">return</span><span class="Delimiter">;</span> +<span id="L629" class="LineNr">629 </span><span class="Delimiter">}</span> +<span id="L630" class="LineNr">630 </span> +<span id="L631" class="LineNr">631 </span><span class="Delimiter">:(before "End Unit Tests")</span> +<span id="L632" class="LineNr">632 </span><span class="Normal">void</span> test_container_address_offsets_in_shape_shifting_container<span class="Delimiter">()</span> <span class="Delimiter">{</span> +<span id="L633" class="LineNr">633 </span> run<span class="Delimiter">(</span><span class="Constant">"container foo:_t [</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L634" class="LineNr">634 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" x:num</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L635" class="LineNr">635 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" y:_t</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L636" class="LineNr">636 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> +<span id="L637" class="LineNr">637 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:foo:&:num"</span><span class="Delimiter">);</span> +<span id="L638" class="LineNr">638 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> +<span id="L639" class="LineNr">639 </span> compute_container_address_offsets<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> +<span id="L640" class="LineNr">640 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L641" class="LineNr">641 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">()));</span> +<span id="L642" class="LineNr">642 </span> set<address_element_info>& offset_info = get<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">());</span> +<span id="L643" class="LineNr">643 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L644" class="LineNr">644 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span>offset<span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">);</span> <span class="Comment">//</span> +<span id="L645" class="LineNr">645 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>atom<span class="Delimiter">);</span> +<span id="L646" class="LineNr">646 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>name<span class="Delimiter">,</span> <span class="Constant">"number"</span><span class="Delimiter">);</span> +<span id="L647" class="LineNr">647 </span><span class="Delimiter">}</span> +<span id="L648" class="LineNr">648 </span> +<span id="L649" class="LineNr">649 </span><span class="Normal">void</span> test_container_address_offsets_in_nested_shape_shifting_container<span class="Delimiter">()</span> <span class="Delimiter">{</span> +<span id="L650" class="LineNr">650 </span> run<span class="Delimiter">(</span><span class="Constant">"container foo:_t [</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L651" class="LineNr">651 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" x:num</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L652" class="LineNr">652 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" y:_t</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L653" class="LineNr">653 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L654" class="LineNr">654 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">"container bar:_t [</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L655" class="LineNr">655 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" x:_t</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L656" class="LineNr">656 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">" y:foo:_t</span><span class="cSpecial">\n</span><span class="Constant">"</span> +<span id="L657" class="LineNr">657 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Constant">"]</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">);</span> +<span id="L658" class="LineNr">658 </span> reagent r<span class="Delimiter">(</span><span class="Constant">"x:bar:&:num"</span><span class="Delimiter">);</span> +<span id="L659" class="LineNr">659 </span> <a href='003trace.cc.html#L158'>CLEAR_TRACE</a><span class="Delimiter">;</span> +<span id="L660" class="LineNr">660 </span> compute_container_sizes<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> +<span id="L661" class="LineNr">661 </span> compute_container_address_offsets<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">""</span><span class="Delimiter">);</span> +<span id="L662" class="LineNr">662 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">),</span> <span class="Constant">1</span><span class="Delimiter">);</span> +<span id="L663" class="LineNr">663 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>contains_key<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">()));</span> +<span id="L664" class="LineNr">664 </span> set<address_element_info>& offset_info = get<span class="Delimiter">(</span>r<span class="Delimiter">.</span>metadata<span class="Delimiter">.</span><a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> set<tag_condition_info><span class="Delimiter">());</span> +<span id="L665" class="LineNr">665 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">),</span> <span class="Constant">2</span><span class="Delimiter">);</span> +<span id="L666" class="LineNr">666 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span>offset<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> <span class="Comment">//</span> +<span id="L667" class="LineNr">667 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>atom<span class="Delimiter">);</span> +<span id="L668" class="LineNr">668 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">(</span>offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">()-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>name<span class="Delimiter">,</span> <span class="Constant">"number"</span><span class="Delimiter">);</span> +<span id="L669" class="LineNr">669 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">((</span>++offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">())-></span>offset<span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">);</span> <span class="Comment">//</span> +<span id="L670" class="LineNr">670 </span> <a href='002test.cc.html#L25'>CHECK</a><span class="Delimiter">((</span>++offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">())-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>atom<span class="Delimiter">);</span> +<span id="L671" class="LineNr">671 </span> <a href='002test.cc.html#L32'>CHECK_EQ</a><span class="Delimiter">((</span>++offset_info<span class="Delimiter">.</span>begin<span class="Delimiter">())-></span><a href='030container.cc.html#L238'>payload_type</a><span class="Delimiter">-></span>name<span class="Delimiter">,</span> <span class="Constant">"number"</span><span class="Delimiter">);</span> +<span id="L672" class="LineNr">672 </span><span class="Delimiter">}</span> +<span id="L673" class="LineNr">673 </span> +<span id="L674" class="LineNr">674 </span><span class="Delimiter">:(scenario typos_in_container_definitions)</span> +<span id="L675" class="LineNr">675 </span><span class="Special">% Hide_errors = true;</span> +<span id="L676" class="LineNr">676 </span><span class="muData">container</span> foo:_t [ +<span id="L677" class="LineNr">677 </span> <span class="Normal">x</span>:adress:_t <span class="Comment"># typo</span> +<span id="L678" class="LineNr">678 </span>] +<span id="L679" class="LineNr">679 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ +<span id="L680" class="LineNr">680 </span> local-scope +<span id="L681" class="LineNr">681 </span> <span class="Normal">x</span>:<a href='043space.cc.html#L76'>address</a>:foo:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Delimiter">{(</span>foo num<span class="Delimiter">)</span>: type<span class="Delimiter">}</span> +<span id="L682" class="LineNr">682 </span>] +<span id="L683" class="LineNr">683 </span><span class="Comment"># no crash</span> +<span id="L684" class="LineNr">684 </span> +<span id="L685" class="LineNr">685 </span><span class="Delimiter">:(scenario typos_in_recipes)</span> +<span id="L686" class="LineNr">686 </span><span class="Special">% Hide_errors = true;</span> +<span id="L687" class="LineNr">687 </span><span class="muRecipe">def</span> foo [ +<span id="L688" class="LineNr">688 </span> local-scope +<span id="L689" class="LineNr">689 </span> <span class="Normal">x</span>:adress:array:number<span class="Special"> <- </span>copy <span class="Constant">0</span> <span class="Comment"># typo</span> +<span id="L690" class="LineNr">690 </span>] +<span id="L691" class="LineNr">691 </span><span class="Comment"># shouldn't crash</span> +<span id="L692" class="LineNr">692 </span> +<span id="L693" class="LineNr">693 </span><span class="SalientComment">//:: 'merge' on shape-shifting containers</span> +<span id="L694" class="LineNr">694 </span> +<span id="L695" class="LineNr">695 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_container_containing_exclusive_container)</span> +<span id="L696" class="LineNr">696 </span><span class="muData">container</span> foo:_elem [ +<span id="L697" class="LineNr">697 </span> <span class="Normal">x</span>:num +<span id="L698" class="LineNr">698 </span> <span class="Normal">y</span>:_elem +<span id="L699" class="LineNr">699 </span>] +<span id="L700" class="LineNr">700 </span><span class="muData">exclusive-container</span> bar [ +<span id="L701" class="LineNr">701 </span> <span class="Normal">x</span>:num +<span id="L702" class="LineNr">702 </span> <span class="Normal">y</span>:num +<span id="L703" class="LineNr">703 </span>] +<span id="L704" class="LineNr">704 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ +<span id="L705" class="LineNr">705 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">23</span><span class="Delimiter">,</span> <span class="Constant">1</span>/y<span class="Delimiter">,</span> <span class="Constant">34</span> +<span id="L706" class="LineNr">706 </span>] +<span id="L707" class="LineNr">707 </span><span class="traceContains">+mem: storing 23 in location 1</span> +<span id="L708" class="LineNr">708 </span><span class="traceContains">+mem: storing 1 in location 2</span> +<span id="L709" class="LineNr">709 </span><span class="traceContains">+mem: storing 34 in location 3</span> +<span id="L710" class="LineNr">710 </span>$error: <span class="Constant">0</span> +<span id="L711" class="LineNr">711 </span> +<span id="L712" class="LineNr">712 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_container_containing_exclusive_container_2)</span> +<span id="L713" class="LineNr">713 </span><span class="Special">% Hide_errors = true;</span> +<span id="L714" class="LineNr">714 </span><span class="muData">container</span> foo:_elem [ +<span id="L715" class="LineNr">715 </span> <span class="Normal">x</span>:num +<span id="L716" class="LineNr">716 </span> <span class="Normal">y</span>:_elem +<span id="L717" class="LineNr">717 </span>] +<span id="L718" class="LineNr">718 </span><span class="muData">exclusive-container</span> bar [ +<span id="L719" class="LineNr">719 </span> <span class="Normal">x</span>:num +<span id="L720" class="LineNr">720 </span> <span class="Normal">y</span>:num +<span id="L721" class="LineNr">721 </span>] +<span id="L722" class="LineNr">722 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ +<span id="L723" class="LineNr">723 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">23</span><span class="Delimiter">,</span> <span class="Constant">1</span>/y<span class="Delimiter">,</span> <span class="Constant">34</span><span class="Delimiter">,</span> <span class="Constant">35</span> +<span id="L724" class="LineNr">724 </span>] +<span id="L725" class="LineNr">725 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: too many ingredients in '1:foo:bar <- merge 23, 1/y, 34, 35'</span> +<span id="L726" class="LineNr">726 </span> +<span id="L727" class="LineNr">727 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_exclusive_container_containing_container)</span> +<span id="L728" class="LineNr">728 </span><span class="muData">exclusive-container</span> foo:_elem [ +<span id="L729" class="LineNr">729 </span> <span class="Normal">x</span>:num +<span id="L730" class="LineNr">730 </span> <span class="Normal">y</span>:_elem +<span id="L731" class="LineNr">731 </span>] +<span id="L732" class="LineNr">732 </span><span class="muData">container</span> bar [ +<span id="L733" class="LineNr">733 </span> <span class="Normal">x</span>:num +<span id="L734" class="LineNr">734 </span> <span class="Normal">y</span>:num <span id="L735" class="LineNr">735 </span>] -<span id="L736" class="LineNr">736 </span>$error: <span class="Constant">0</span> -<span id="L737" class="LineNr">737 </span> -<span id="L738" class="LineNr">738 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_exclusive_container_containing_container_3)</span> -<span id="L739" class="LineNr">739 </span><span class="Special">% Hide_errors = true;</span> -<span id="L740" class="LineNr">740 </span><span class="muData">exclusive-container</span> foo:_elem [ -<span id="L741" class="LineNr">741 </span> <span class="Normal">x</span>:num -<span id="L742" class="LineNr">742 </span> <span class="Normal">y</span>:_elem -<span id="L743" class="LineNr">743 </span>] -<span id="L744" class="LineNr">744 </span><span class="muData">container</span> bar [ -<span id="L745" class="LineNr">745 </span> <span class="Normal">x</span>:num -<span id="L746" class="LineNr">746 </span> <span class="Normal">y</span>:num -<span id="L747" class="LineNr">747 </span>] -<span id="L748" class="LineNr">748 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L749" class="LineNr">749 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">1</span>/y<span class="Delimiter">,</span> <span class="Constant">23</span> -<span id="L750" class="LineNr">750 </span>] -<span id="L751" class="LineNr">751 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: too few ingredients in '1:foo:bar <- merge 1/y, 23'</span> +<span id="L736" class="LineNr">736 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ +<span id="L737" class="LineNr">737 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">1</span>/y<span class="Delimiter">,</span> <span class="Constant">23</span><span class="Delimiter">,</span> <span class="Constant">34</span> +<span id="L738" class="LineNr">738 </span>] +<span id="L739" class="LineNr">739 </span><span class="traceContains">+mem: storing 1 in location 1</span> +<span id="L740" class="LineNr">740 </span><span class="traceContains">+mem: storing 23 in location 2</span> +<span id="L741" class="LineNr">741 </span><span class="traceContains">+mem: storing 34 in location 3</span> +<span id="L742" class="LineNr">742 </span>$error: <span class="Constant">0</span> +<span id="L743" class="LineNr">743 </span> +<span id="L744" class="LineNr">744 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_exclusive_container_containing_container_2)</span> +<span id="L745" class="LineNr">745 </span><span class="muData">exclusive-container</span> foo:_elem [ +<span id="L746" class="LineNr">746 </span> <span class="Normal">x</span>:num +<span id="L747" class="LineNr">747 </span> <span class="Normal">y</span>:_elem +<span id="L748" class="LineNr">748 </span>] +<span id="L749" class="LineNr">749 </span><span class="muData">container</span> bar [ +<span id="L750" class="LineNr">750 </span> <span class="Normal">x</span>:num +<span id="L751" class="LineNr">751 </span> <span class="Normal">y</span>:num +<span id="L752" class="LineNr">752 </span>] +<span id="L753" class="LineNr">753 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ +<span id="L754" class="LineNr">754 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">0</span>/x<span class="Delimiter">,</span> <span class="Constant">23</span> +<span id="L755" class="LineNr">755 </span>] +<span id="L756" class="LineNr">756 </span>$error: <span class="Constant">0</span> +<span id="L757" class="LineNr">757 </span> +<span id="L758" class="LineNr">758 </span><span class="Delimiter">:(scenario merge_check_shape_shifting_exclusive_container_containing_container_3)</span> +<span id="L759" class="LineNr">759 </span><span class="Special">% Hide_errors = true;</span> +<span id="L760" class="LineNr">760 </span><span class="muData">exclusive-container</span> foo:_elem [ +<span id="L761" class="LineNr">761 </span> <span class="Normal">x</span>:num +<span id="L762" class="LineNr">762 </span> <span class="Normal">y</span>:_elem +<span id="L763" class="LineNr">763 </span>] +<span id="L764" class="LineNr">764 </span><span class="muData">container</span> bar [ +<span id="L765" class="LineNr">765 </span> <span class="Normal">x</span>:num +<span id="L766" class="LineNr">766 </span> <span class="Normal">y</span>:num +<span id="L767" class="LineNr">767 </span>] +<span id="L768" class="LineNr">768 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ +<span id="L769" class="LineNr">769 </span> <span class="Constant">1</span>:foo:bar<span class="Special"> <- </span>merge <span class="Constant">1</span>/y<span class="Delimiter">,</span> <span class="Constant">23</span> +<span id="L770" class="LineNr">770 </span>] +<span id="L771" class="LineNr">771 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: too few ingredients in '1:foo:bar <- merge 1/y, 23'</span> </pre> </body> </html> |