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/043space.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/043space.cc.html')
-rw-r--r-- | html/043space.cc.html | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/html/043space.cc.html b/html/043space.cc.html index 036f7def..1c862968 100644 --- a/html/043space.cc.html +++ b/html/043space.cc.html @@ -16,13 +16,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Constant { color: #00a0a0; } .traceAbsent { color: #c00000; } .cSpecial { color: #008000; } -.traceContains { color: #008000; } +.muRecipe { color: #ff8700; } .SalientComment { color: #00ffff; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.traceContains { color: #008000; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.muData { color: #ffff00; } +.Identifier { color: #fcb165; } --> </style> @@ -47,7 +49,7 @@ put<span class="Delimiter">(</span>Type_abbreviations<span class="Delimiter">,</ <span class="Delimiter">:(scenario set_default_space)</span> <span class="Comment"># if default-space is 10, and if an array of 5 locals lies from location 12 to 16 (inclusive),</span> <span class="Comment"># then local 0 is really location 12, local 1 is really location 13, and so on.</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Comment"># pretend address:array:location; in practice we'll use new</span> <span class="Constant">10</span>:num<span class="Special"> <- </span>copy <span class="Constant">0</span> <span class="Comment"># refcount</span> <span class="Constant">11</span>:num<span class="Special"> <- </span>copy <span class="Constant">5</span> <span class="Comment"># length</span> @@ -57,7 +59,7 @@ def main [ <span class="traceContains">+mem: storing 23 in location 13</span> <span class="Delimiter">:(scenario lookup_sidesteps_default_space)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Comment"># pretend pointer from outside (2000 reserved for refcount)</span> <span class="Constant">2001</span>:num<span class="Special"> <- </span>copy <span class="Constant">34</span> <span class="Comment"># pretend address:array:location; in practice we'll use new</span> @@ -73,7 +75,7 @@ def main [ <span class="SalientComment">//:: first disable name conversion for 'default-space'</span> <span class="Delimiter">:(scenario convert_names_passes_default_space)</span> <span class="Special">% Hide_errors = true;</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Normal">default</span>-space:num<span class="Delimiter">,</span> x:num<span class="Special"> <- </span>copy <span class="Constant">0</span><span class="Delimiter">,</span> <span class="Constant">1</span> ] <span class="traceContains">+name: assign x 1</span> @@ -136,7 +138,7 @@ absolutize<span class="Delimiter">(</span>x<span class="Delimiter">);</span> <span class="Delimiter">}</span> <span class="Delimiter">:(scenario get_default_space)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Normal">default</span>-space:space<span class="Special"> <- </span>copy <span class="Constant">10</span>/unsafe <span class="Constant">1</span>:space/<span class="Special">raw <- </span>copy <span class="Normal">default</span>-space:space ] @@ -152,7 +154,7 @@ def main [ <span class="SalientComment">//:: fix 'get'</span> <span class="Delimiter">:(scenario lookup_sidesteps_default_space_in_get)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Comment"># pretend pointer to container from outside (2000 reserved for refcount)</span> <span class="Constant">2001</span>:num<span class="Special"> <- </span>copy <span class="Constant">34</span> <span class="Constant">2002</span>:num<span class="Special"> <- </span>copy <span class="Constant">35</span> @@ -162,7 +164,7 @@ def main [ <span class="Comment"># actual start of this recipe</span> <span class="Normal">default</span>-space:space<span class="Special"> <- </span>copy <span class="Constant">1000</span>/unsafe <span class="Constant">1</span>:&:point<span class="Special"> <- </span>copy <span class="Constant">2000</span>/unsafe - <span class="Constant">9</span>:num/<span class="Special">raw <- </span>get *<span class="Constant">1</span>:&:point<span class="Delimiter">,</span> <span class="Constant">1</span>:offset + <span class="Constant">9</span>:num/<span class="Special">raw <- </span>get *<span class="Constant">1</span>:&:point<span class="Delimiter">,</span> <span class="Constant">1:offset</span> ] <span class="traceContains">+mem: storing 35 in location 9</span> @@ -172,7 +174,7 @@ element<span class="Delimiter">.</span>properties<span class="Delimiter">.</span <span class="SalientComment">//:: fix 'index'</span> <span class="Delimiter">:(scenario lookup_sidesteps_default_space_in_index)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Comment"># pretend pointer to array from outside (2000 reserved for refcount)</span> <span class="Constant">2001</span>:num<span class="Special"> <- </span>copy <span class="Constant">2</span> <span class="Comment"># length</span> <span class="Constant">2002</span>:num<span class="Special"> <- </span>copy <span class="Constant">34</span> @@ -194,7 +196,7 @@ element<span class="Delimiter">.</span>properties<span class="Delimiter">.</span <span class="SalientComment">//:: allocate in a default space with names</span> <span class="Delimiter">:(scenario new_default_space)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Normal">new</span>-<span class="Normal">default</span>-space <span class="Normal">x</span>:num<span class="Special"> <- </span>copy <span class="Constant">0</span> <span class="Normal">y</span>:num<span class="Special"> <- </span>copy <span class="Constant">3</span> @@ -233,12 +235,12 @@ def main [ <span class="SalientComment">//:: default-space when the routine exits</span> <span class="Delimiter">:(scenario local_scope)</span> -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:&<span class="Special"> <- </span>foo <span class="Constant">2</span>:&<span class="Special"> <- </span>foo <span class="Constant">3</span>:<span class="Normal">bool</span><span class="Special"> <- </span>equal <span class="Constant">1</span>:&<span class="Delimiter">,</span> <span class="Constant">2</span>:& ] -def foo [ +<span class="muRecipe">def</span> foo [ local-scope <span class="Normal">x</span>:num<span class="Special"> <- </span>copy <span class="Constant">34</span> <span class="Identifier">return</span> <span class="Normal">default</span>-space:space @@ -247,7 +249,7 @@ def foo [ <span class="traceContains">+mem: storing 1 in location 3</span> <span class="Delimiter">:(scenario local_scope_frees_up_addresses)</span> -def main [ +<span class="muRecipe">def</span> main [ local-scope <span class="Normal">x</span>:text<span class="Special"> <- </span><span class="Normal">new</span> [abc] ] @@ -342,21 +344,21 @@ Update_refcounts_in_write_memory = <span class="Constant">true</span><span class <span class="Normal">if</span> <span class="Delimiter">(</span>!curr<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> raise << to_original_string<span class="Delimiter">(</span>curr<span class="Delimiter">)</span> << <span class="Constant">" can't take any ingredients</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> curr<span class="Delimiter">.</span>name = <span class="Constant">"new"</span><span class="Delimiter">;</span> - curr<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span><span class="Constant">"location:type"</span><span class="Delimiter">));</span> - curr<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span><span class="Constant">"number-of-locals:literal"</span><span class="Delimiter">));</span> + <span class="Constant">curr.ingredients.push_back(reagent("location:type</span><span class="Constant">"));</span> + <span class="Constant">curr.ingredients.push_back(reagent("number-of-locals:literal</span><span class="Constant">"));</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> raise << <span class="Constant">"new-default-space can't take any results</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span><span class="Constant">"default-space:space"</span><span class="Delimiter">));</span> <span class="Delimiter">}</span> <span class="Delimiter">:(scenario local_scope_frees_up_addresses_inside_containers)</span> -container foo [ +<span class="muData">container</span> foo [ <span class="Normal">x</span>:num <span class="Normal">y</span>:&:num ] -def main [ +<span class="muRecipe">def</span> main [ local-scope - <span class="Normal">x</span>:&:num<span class="Special"> <- </span><span class="Normal">new</span> number:type + <span class="Normal">x</span>:&:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> <span class="Normal">y</span>:foo<span class="Special"> <- </span>merge <span class="Constant">34</span><span class="Delimiter">,</span> x:&:num <span class="Comment"># x and y are both cleared when main returns</span> ] @@ -367,24 +369,24 @@ def main [ <span class="traceContains">+mem: automatically abandoning 1006</span> <span class="Delimiter">:(scenario local_scope_returns_addresses_inside_containers)</span> -container foo [ +<span class="muData">container</span> foo [ <span class="Normal">x</span>:num <span class="Normal">y</span>:&:num ] -def f [ +<span class="muRecipe">def</span> f [ local-scope - <span class="Normal">x</span>:&:num<span class="Special"> <- </span><span class="Normal">new</span> number:type + <span class="Normal">x</span>:&:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> *x:&:num<span class="Special"> <- </span>copy <span class="Constant">12</span> <span class="Normal">y</span>:foo<span class="Special"> <- </span>merge <span class="Constant">34</span><span class="Delimiter">,</span> x:&:num <span class="Comment"># since y is 'escaping' f, it should not be cleared</span> <span class="Identifier">return</span> y:foo ] -def main [ +<span class="muRecipe">def</span> main [ <span class="Constant">1</span>:foo<span class="Special"> <- </span>f - <span class="Constant">3</span>:num<span class="Special"> <- </span>get <span class="Constant">1</span>:foo<span class="Delimiter">,</span> x:offset - <span class="Constant">4</span>:&:num<span class="Special"> <- </span>get <span class="Constant">1</span>:foo<span class="Delimiter">,</span> y:offset + <span class="Constant">3</span>:num<span class="Special"> <- </span>get <span class="Constant">1</span>:foo<span class="Delimiter">,</span> <span class="Constant">x:offset</span> + <span class="Constant">4</span>:&:num<span class="Special"> <- </span>get <span class="Constant">1</span>:foo<span class="Delimiter">,</span> <span class="Constant">y:offset</span> <span class="Constant">5</span>:num<span class="Special"> <- </span>copy *<span class="Constant">4</span>:&:num - <span class="Constant">1</span>:foo<span class="Special"> <- </span>put <span class="Constant">1</span>:foo<span class="Delimiter">,</span> y:offset<span class="Delimiter">,</span> <span class="Constant">0</span> + <span class="Constant">1</span>:foo<span class="Special"> <- </span>put <span class="Constant">1</span>:foo<span class="Delimiter">,</span> <span class="Constant">y:offset</span><span class="Delimiter">,</span> <span class="Constant">0</span> <span class="Constant">4</span>:&:num<span class="Special"> <- </span>copy <span class="Constant">0</span> ] <span class="traceContains">+mem: storing 34 in location 1</span> @@ -403,12 +405,12 @@ def main [ <span class="traceContains">+mem: automatically abandoning 1006</span> <span class="Delimiter">:(scenario local_scope_claims_return_values_when_not_saved)</span> -def f [ +<span class="muRecipe">def</span> f [ local-scope - <span class="Normal">x</span>:&:num<span class="Special"> <- </span><span class="Normal">new</span> number:type + <span class="Normal">x</span>:&:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> reply x:&:num ] -def main [ +<span class="muRecipe">def</span> main [ f <span class="Comment"># doesn't save result</span> ] <span class="Comment"># x reclaimed</span> |