diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-27 11:26:42 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-27 11:26:42 -0700 |
commit | fcf35c1315773edb2061b6bbd87b0963eecbd097 (patch) | |
tree | cfeb566d121df94c0d77fd451ef29e28571f9eef /html/053recipe_header.cc.html | |
parent | d4fd180fa051b03ff32cf74dfc5874eef4bdbdeb (diff) | |
download | mu-fcf35c1315773edb2061b6bbd87b0963eecbd097.tar.gz |
3604
Diffstat (limited to 'html/053recipe_header.cc.html')
-rw-r--r-- | html/053recipe_header.cc.html | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/html/053recipe_header.cc.html b/html/053recipe_header.cc.html index 021db5f4..a922f9e2 100644 --- a/html/053recipe_header.cc.html +++ b/html/053recipe_header.cc.html @@ -266,7 +266,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span local-scope <span class="Normal">b</span>:num<span class="Special"> <- </span>add a:num<span class="Delimiter">,</span> <span class="Constant">1</span> ] -<span class="traceContains">+error: foo: use before set: 'a'</span> +<span class="traceContains">+error: foo: tried to read ingredient 'a' in 'b:num <- add a:num, 1' but it hasn't been written to yet</span> <span class="traceContains">+error: did you forget 'load-ingredients'?</span> <span class="Delimiter">:(after "use-before-set Error")</span> @@ -286,6 +286,15 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Normal">if</span> <span class="Delimiter">(</span>is_present_in_ingredients<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> recipe_name<span class="Delimiter">)),</span> x<span class="Delimiter">.</span>name<span class="Delimiter">))</span> raise << <span class="Constant">" did you forget 'load-ingredients'?</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span class="Delimiter">:(code)</span> +<span class="Normal">bool</span> is_present_in_ingredients<span class="Delimiter">(</span><span class="Normal">const</span> recipe& callee<span class="Delimiter">,</span> <span class="Normal">const</span> string& ingredient_name<span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name == ingredient_name<span class="Delimiter">)</span> + <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> + <span class="Delimiter">}</span> + <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span class="Delimiter">}</span> + <span class="SalientComment">//:: Check all calls against headers.</span> <span class="Delimiter">:(scenario show_clear_error_on_bad_call)</span> |