diff options
Diffstat (limited to 'html/031address.cc.html')
-rw-r--r-- | html/031address.cc.html | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/html/031address.cc.html b/html/031address.cc.html index 1709e1a1..06c08de7 100644 --- a/html/031address.cc.html +++ b/html/031address.cc.html @@ -13,9 +13,10 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } +.traceAbsent { color: #c00000; } .traceContains { color: #008000; } -.cSpecial { color: #008000; } .Constant { color: #00a0a0; } +.cSpecial { color: #008000; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #a04060; } @@ -59,6 +60,20 @@ recipe main [ <span class="Delimiter">:(before "long long int base = x.value" following "void write_memory(reagent x, vector<double> data)")</span> x = canonize<span class="Delimiter">(</span>x<span class="Delimiter">);</span> +if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>value == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> + raise << <span class="Constant">"can't write to location 0 in '"</span> << current_instruction<span class="Delimiter">().</span>to_string<span class="Delimiter">()</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> + <span class="Identifier">return</span><span class="Delimiter">;</span> +<span class="Delimiter">}</span> + +<span class="Comment">//: writes to address 0 always loudly fail</span> +<span class="Delimiter">:(scenario store_to_0_warns)</span> +<span class="Special">% Hide_warnings = true;</span> +recipe main [ + <span class="Constant">1</span>:address:number<span class="Special"> <- </span>copy <span class="Constant">0</span> + <span class="Constant">1</span>:address:number/lookup<span class="Special"> <- </span>copy <span class="Constant">34</span> +] +<span class="traceAbsent">-mem: storing 34 in location 0</span> +<span class="traceContains">+warn: can't write to location 0 in '1:address:number/lookup <- copy 34'</span> <span class="Delimiter">:(code)</span> reagent canonize<span class="Delimiter">(</span>reagent x<span class="Delimiter">)</span> <span class="Delimiter">{</span> |