diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-30 10:45:14 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-30 10:45:14 -0700 |
commit | 3e1349d29fa00db1fab3a811b60bc9d8de0355e4 (patch) | |
tree | 93afedf36b8b211432a458ca9c0c7bfaf76e2425 /html/022arithmetic.cc.html | |
parent | 6c69569a4c4ca3a23635d4d7a40f0fe557194619 (diff) | |
download | mu-3e1349d29fa00db1fab3a811b60bc9d8de0355e4.tar.gz |
3431
Improvements to syntax highlighting, particularly for Mu code in C++ files.
Diffstat (limited to 'html/022arithmetic.cc.html')
-rw-r--r-- | html/022arithmetic.cc.html | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/html/022arithmetic.cc.html b/html/022arithmetic.cc.html index 476f505a..c8fefec6 100644 --- a/html/022arithmetic.cc.html +++ b/html/022arithmetic.cc.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muRecipe { color: #ff8700; } .traceContains { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } @@ -70,13 +71,13 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario add_literal)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>add <span class="Constant">23</span><span class="Delimiter">,</span> <span class="Constant">34</span> ] <span class="traceContains">+mem: storing 57 in location 1</span> <span class="Delimiter">:(scenario add)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">23</span> <span class="Constant">2</span>:num<span class="Special"> <- </span>copy <span class="Constant">34</span> <span class="Constant">3</span>:num<span class="Special"> <- </span>add <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">2</span>:num @@ -84,21 +85,21 @@ def main [ <span class="traceContains">+mem: storing 57 in location 3</span> <span class="Delimiter">:(scenario add_multiple)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>add <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">4</span><span class="Delimiter">,</span> <span class="Constant">5</span> ] <span class="traceContains">+mem: storing 12 in location 1</span> <span class="Delimiter">:(scenario add_checks_type)</span> <span class="Special">% Hide_errors = true;</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>add <span class="Constant">2</span>:<span class="Normal">bool</span><span class="Delimiter">,</span> <span class="Constant">1</span> ] <span class="traceContains">+error: main: 'add' requires number ingredients, but got '2:bool'</span> <span class="Delimiter">:(scenario add_checks_return_type)</span> <span class="Special">% Hide_errors = true;</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:address:num<span class="Special"> <- </span>add <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+error: main: 'add' should yield a number, but got '1:address:num'</span> @@ -145,13 +146,13 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario subtract_literal)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>subtract <span class="Constant">5</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+mem: storing 3 in location 1</span> <span class="Delimiter">:(scenario subtract)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">23</span> <span class="Constant">2</span>:num<span class="Special"> <- </span>copy <span class="Constant">34</span> <span class="Constant">3</span>:num<span class="Special"> <- </span>subtract <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">2</span>:num @@ -159,7 +160,7 @@ def main [ <span class="traceContains">+mem: storing -11 in location 3</span> <span class="Delimiter">:(scenario subtract_multiple)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>subtract <span class="Constant">6</span><span class="Delimiter">,</span> <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+mem: storing 1 in location 1</span> @@ -198,13 +199,13 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario multiply_literal)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>multiply <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">3</span> ] <span class="traceContains">+mem: storing 6 in location 1</span> <span class="Delimiter">:(scenario multiply)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">4</span> <span class="Constant">2</span>:num<span class="Special"> <- </span>copy <span class="Constant">6</span> <span class="Constant">3</span>:num<span class="Special"> <- </span>multiply <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">2</span>:num @@ -212,7 +213,7 @@ def main [ <span class="traceContains">+mem: storing 24 in location 3</span> <span class="Delimiter">:(scenario multiply_multiple)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>multiply <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">4</span> ] <span class="traceContains">+mem: storing 24 in location 1</span> @@ -254,13 +255,13 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario divide_literal)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>divide <span class="Constant">8</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+mem: storing 4 in location 1</span> <span class="Delimiter">:(scenario divide)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">27</span> <span class="Constant">2</span>:num<span class="Special"> <- </span>copy <span class="Constant">3</span> <span class="Constant">3</span>:num<span class="Special"> <- </span>divide <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">2</span>:num @@ -268,7 +269,7 @@ def main [ <span class="traceContains">+mem: storing 9 in location 3</span> <span class="Delimiter">:(scenario divide_multiple)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>divide <span class="Constant">12</span><span class="Delimiter">,</span> <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+mem: storing 2 in location 1</span> @@ -322,14 +323,14 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario divide_with_remainder_literal)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">2</span>:num<span class="Special"> <- </span>divide-with-remainder <span class="Constant">9</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+mem: storing 4 in location 1</span> <span class="traceContains">+mem: storing 1 in location 2</span> <span class="Delimiter">:(scenario divide_with_remainder)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>copy <span class="Constant">27</span> <span class="Constant">2</span>:num<span class="Special"> <- </span>copy <span class="Constant">11</span> <span class="Constant">3</span>:num<span class="Delimiter">,</span> <span class="Constant">4</span>:num<span class="Special"> <- </span>divide-with-remainder <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">2</span>:num @@ -338,20 +339,20 @@ def main [ <span class="traceContains">+mem: storing 5 in location 4</span> <span class="Delimiter">:(scenario divide_with_decimal_point)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>divide <span class="Constant">5</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+mem: storing 2.5 in location 1</span> <span class="Delimiter">:(scenario divide_by_zero)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>divide <span class="Constant">4</span><span class="Delimiter">,</span> <span class="Constant">0</span> ] <span class="traceContains">+mem: storing inf in location 1</span> <span class="Delimiter">:(scenario divide_by_zero_2)</span> <span class="Special">% Hide_errors = true;</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>divide-with-remainder <span class="Constant">4</span><span class="Delimiter">,</span> <span class="Constant">0</span> ] <span class="Comment"># integer division can't return floating-point infinity</span> @@ -399,32 +400,32 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario shift_left_by_zero)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>shift-left <span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">0</span> ] <span class="traceContains">+mem: storing 1 in location 1</span> <span class="Delimiter">:(scenario shift_left_1)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>shift-left <span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">4</span> ] <span class="traceContains">+mem: storing 16 in location 1</span> <span class="Delimiter">:(scenario shift_left_2)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>shift-left <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+mem: storing 12 in location 1</span> <span class="Delimiter">:(scenario shift_left_by_negative)</span> <span class="Special">% Hide_errors = true;</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>shift-left <span class="Constant">3</span><span class="Delimiter">,</span> -<span class="Constant">1</span> ] <span class="traceContains">+error: main: second ingredient can't be negative in '1:num <- shift-left 3, -1'</span> <span class="Delimiter">:(scenario shift_left_ignores_fractional_part)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>divide <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">2</span> <span class="Constant">2</span>:num<span class="Special"> <- </span>shift-left <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">1</span> ] @@ -470,32 +471,32 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario shift_right_by_zero)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>shift-right <span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">0</span> ] <span class="traceContains">+mem: storing 1 in location 1</span> <span class="Delimiter">:(scenario shift_right_1)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>shift-right <span class="Constant">1024</span><span class="Delimiter">,</span> <span class="Constant">1</span> ] <span class="traceContains">+mem: storing 512 in location 1</span> <span class="Delimiter">:(scenario shift_right_2)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>shift-right <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">1</span> ] <span class="traceContains">+mem: storing 1 in location 1</span> <span class="Delimiter">:(scenario shift_right_by_negative)</span> <span class="Special">% Hide_errors = true;</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>shift-right <span class="Constant">4</span><span class="Delimiter">,</span> -<span class="Constant">1</span> ] <span class="traceContains">+error: main: second ingredient can't be negative in '1:num <- shift-right 4, -1'</span> <span class="Delimiter">:(scenario shift_right_ignores_fractional_part)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>divide <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">2</span> <span class="Constant">2</span>:num<span class="Special"> <- </span>shift-right <span class="Constant">1</span>:num<span class="Delimiter">,</span> <span class="Constant">1</span> ] @@ -536,25 +537,25 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario and_bits_1)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">and</span>-bits <span class="Constant">8</span><span class="Delimiter">,</span> <span class="Constant">3</span> ] <span class="traceContains">+mem: storing 0 in location 1</span> <span class="Delimiter">:(scenario and_bits_2)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">and</span>-bits <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">2</span> ] <span class="traceContains">+mem: storing 2 in location 1</span> <span class="Delimiter">:(scenario and_bits_3)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">and</span>-bits <span class="Constant">14</span><span class="Delimiter">,</span> <span class="Constant">3</span> ] <span class="traceContains">+mem: storing 2 in location 1</span> <span class="Delimiter">:(scenario and_bits_negative)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">and</span>-bits -<span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">4</span> ] <span class="traceContains">+mem: storing 4 in location 1</span> @@ -594,19 +595,19 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario or_bits_1)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">or</span>-bits <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">8</span> ] <span class="traceContains">+mem: storing 11 in location 1</span> <span class="Delimiter">:(scenario or_bits_2)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">or</span>-bits <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">10</span> ] <span class="traceContains">+mem: storing 11 in location 1</span> <span class="Delimiter">:(scenario or_bits_3)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">or</span>-bits <span class="Constant">4</span><span class="Delimiter">,</span> <span class="Constant">6</span> ] <span class="traceContains">+mem: storing 6 in location 1</span> @@ -646,19 +647,19 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario xor_bits_1)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">xor</span>-bits <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">8</span> ] <span class="traceContains">+mem: storing 11 in location 1</span> <span class="Delimiter">:(scenario xor_bits_2)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">xor</span>-bits <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">10</span> ] <span class="traceContains">+mem: storing 9 in location 1</span> <span class="Delimiter">:(scenario xor_bits_3)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span><span class="Normal">xor</span>-bits <span class="Constant">4</span><span class="Delimiter">,</span> <span class="Constant">6</span> ] <span class="traceContains">+mem: storing 2 in location 1</span> @@ -697,25 +698,25 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario flip_bits_zero)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>flip-bits <span class="Constant">0</span> ] <span class="traceContains">+mem: storing -1 in location 1</span> <span class="Delimiter">:(scenario flip_bits_negative)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>flip-bits -<span class="Constant">1</span> ] <span class="traceContains">+mem: storing 0 in location 1</span> <span class="Delimiter">:(scenario flip_bits_1)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>flip-bits <span class="Constant">3</span> ] <span class="traceContains">+mem: storing -4 in location 1</span> <span class="Delimiter">:(scenario flip_bits_2)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>flip-bits <span class="Constant">12</span> ] <span class="traceContains">+mem: storing -13 in location 1</span> @@ -744,7 +745,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Delimiter">}</span> <span class="Delimiter">:(scenario round_to_nearest_integer)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:num<span class="Special"> <- </span>round <span class="Constant">12.2</span> ] <span class="traceContains">+mem: storing 12 in location 1</span> |