diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-04-25 22:27:19 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-04-25 22:27:19 -0700 |
commit | 32b8fac2799ac7cec613e84a3eb9c009141b6a3a (patch) | |
tree | 11f56c1a235abf7b626ea8983fff3d2edb1fcf98 /html/021check_instruction.cc.html | |
parent | 224972ee9871fcb06ee285fa5f3d9528c034d414 (diff) | |
download | mu-32b8fac2799ac7cec613e84a3eb9c009141b6a3a.tar.gz |
2866
Diffstat (limited to 'html/021check_instruction.cc.html')
-rw-r--r-- | html/021check_instruction.cc.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/html/021check_instruction.cc.html b/html/021check_instruction.cc.html index 580a32f6..7771ea55 100644 --- a/html/021check_instruction.cc.html +++ b/html/021check_instruction.cc.html @@ -191,10 +191,23 @@ $error: <span class="Constant">0</span> <span class="Normal">bool</span> types_strictly_match<span class="Delimiter">(</span>type_tree* to<span class="Delimiter">,</span> type_tree* from<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!to<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!from<span class="Delimiter">)</span> <span class="Identifier">return</span> to<span class="Delimiter">-></span>value == <span class="Constant">0</span><span class="Delimiter">;</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>from<span class="Delimiter">-></span>value == -<span class="Constant">1</span><span class="Delimiter">)</span> <span class="Identifier">return</span> from<span class="Delimiter">-></span>name == to<span class="Delimiter">-></span>name<span class="Delimiter">;</span> <span class="Normal">if</span> <span class="Delimiter">(</span>to<span class="Delimiter">-></span>value != from<span class="Delimiter">-></span>value<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="Identifier">return</span> types_strictly_match<span class="Delimiter">(</span>to<span class="Delimiter">-></span>left<span class="Delimiter">,</span> from<span class="Delimiter">-></span>left<span class="Delimiter">)</span> && types_strictly_match<span class="Delimiter">(</span>to<span class="Delimiter">-></span>right<span class="Delimiter">,</span> from<span class="Delimiter">-></span>right<span class="Delimiter">);</span> <span class="Delimiter">}</span> +<span class="Normal">void</span> test_unknown_type_does_not_match_unknown_type<span class="Delimiter">()</span> <span class="Delimiter">{</span> + reagent a<span class="Delimiter">(</span><span class="Constant">"a:foo"</span><span class="Delimiter">);</span> + reagent b<span class="Delimiter">(</span><span class="Constant">"b:bar"</span><span class="Delimiter">);</span> + CHECK<span class="Delimiter">(</span>!types_strictly_match<span class="Delimiter">(</span>a<span class="Delimiter">,</span> b<span class="Delimiter">));</span> +<span class="Delimiter">}</span> + +<span class="Normal">void</span> test_unknown_type_matches_itself<span class="Delimiter">()</span> <span class="Delimiter">{</span> + reagent a<span class="Delimiter">(</span><span class="Constant">"a:foo"</span><span class="Delimiter">);</span> + reagent b<span class="Delimiter">(</span><span class="Constant">"b:foo"</span><span class="Delimiter">);</span> + CHECK<span class="Delimiter">(</span>types_strictly_match<span class="Delimiter">(</span>a<span class="Delimiter">,</span> b<span class="Delimiter">));</span> +<span class="Delimiter">}</span> + <span class="Normal">bool</span> is_unsafe<span class="Delimiter">(</span><span class="Normal">const</span> reagent& r<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Identifier">return</span> has_property<span class="Delimiter">(</span>r<span class="Delimiter">,</span> <span class="Constant">"unsafe"</span><span class="Delimiter">);</span> <span class="Delimiter">}</span> |