diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-08-06 19:15:57 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-08-06 19:15:57 -0700 |
commit | eaeb955212eb3b133fd98d98457f17bfea8891d1 (patch) | |
tree | 4dbf20c0a79c460ea0ed129594670c58818a2dd4 /html/045space_surround.cc.html | |
parent | 5d1699c2c75adc9670bf14404466c8056910b709 (diff) | |
download | mu-eaeb955212eb3b133fd98d98457f17bfea8891d1.tar.gz |
1949
Diffstat (limited to 'html/045space_surround.cc.html')
-rw-r--r-- | html/045space_surround.cc.html | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/html/045space_surround.cc.html b/html/045space_surround.cc.html index 87f5ff46..a2705517 100644 --- a/html/045space_surround.cc.html +++ b/html/045space_surround.cc.html @@ -16,6 +16,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } .traceContains { color: #008000; } .Constant { color: #00a0a0; } .cSpecial { color: #008000; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .Comment { color: #9090ff; } .Delimiter { color: #a04060; } .Special { color: #ff6060; } @@ -42,7 +43,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } recipe main [ <span class="Constant">10</span>:number<span class="Special"> <- </span>copy <span class="Constant">5</span> <span class="Comment"># pretend array</span> <span class="Constant">20</span>:number<span class="Special"> <- </span>copy <span class="Constant">5</span> <span class="Comment"># pretend array</span> - default-space:address:array:location<span class="Special"> <- </span>copy <span class="Constant">10</span> + <span class="Normal">default</span>-space:address:array:location<span class="Special"> <- </span>copy <span class="Constant">10</span> <span class="Constant">0</span>:address:array:location/names:dummy<span class="Special"> <- </span>copy <span class="Constant">20</span> <span class="Comment"># later layers will explain the /names: property</span> <span class="Constant">1</span>:number<span class="Special"> <- </span>copy <span class="Constant">32</span> <span class="Constant">1</span>:number/space:<span class="Constant">1</span><span class="Special"> <- </span>copy <span class="Constant">33</span> @@ -59,22 +60,22 @@ recipe main [ <span class="Comment">//: one.</span> <span class="Delimiter">:(replace{} "long long int space_base(const reagent& x)")</span> -long long int space_base<span class="Delimiter">(</span>const reagent& x<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> space_base<span class="Delimiter">(</span><span class="Normal">const</span> reagent& x<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Identifier">return</span> space_base<span class="Delimiter">(</span>x<span class="Delimiter">,</span> space_index<span class="Delimiter">(</span>x<span class="Delimiter">),</span> Current_routine<span class="Delimiter">-></span>calls<span class="Delimiter">.</span>front<span class="Delimiter">().</span>default_space<span class="Delimiter">);</span> <span class="Delimiter">}</span> -long long int space_base<span class="Delimiter">(</span>const reagent& x<span class="Delimiter">,</span> long long int space_index<span class="Delimiter">,</span> long long int base<span class="Delimiter">)</span> <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>space_index == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> space_base<span class="Delimiter">(</span><span class="Normal">const</span> reagent& x<span class="Delimiter">,</span> <span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> space_index<span class="Delimiter">,</span> <span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> base<span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>space_index == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Identifier">return</span> base<span class="Delimiter">;</span> <span class="Delimiter">}</span> - long long int result = space_base<span class="Delimiter">(</span>x<span class="Delimiter">,</span> space_index-<span class="Constant">1</span><span class="Delimiter">,</span> Memory[base+<span class="Constant">1</span>]<span class="Delimiter">);</span> + <span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> result = space_base<span class="Delimiter">(</span>x<span class="Delimiter">,</span> space_index-<span class="Constant">1</span><span class="Delimiter">,</span> Memory[base+<span class="Constant">1</span>]<span class="Delimiter">);</span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span class="Delimiter">}</span> -long long int space_index<span class="Delimiter">(</span>const reagent& x<span class="Delimiter">)</span> <span class="Delimiter">{</span> - for <span class="Delimiter">(</span>long long int i = <span class="Comment">/*</span><span class="Comment">skip name:type</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>first == <span class="Constant">"space"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">)</span> != <span class="Constant">1</span><span class="Delimiter">)</span> +<span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> space_index<span class="Delimiter">(</span><span class="Normal">const</span> reagent& x<span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> i = <span class="Comment">/*</span><span class="Comment">skip name:type</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>first == <span class="Constant">"space"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">)</span> != <span class="Constant">1</span><span class="Delimiter">)</span> raise << current_recipe_name<span class="Delimiter">()</span> << <span class="Constant">": /space metadata should take exactly one value in "</span> << x<span class="Delimiter">.</span>original_string << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> <span class="Identifier">return</span> to_integer<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>second<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> <span class="Delimiter">}</span> @@ -84,7 +85,7 @@ long long int space_index<span class="Delimiter">(</span>const reagent& x<sp <span class="Delimiter">:(scenario permit_space_as_variable_name)</span> recipe main [ - space:number<span class="Special"> <- </span>copy <span class="Constant">0</span> + <span class="Normal">space</span>:number<span class="Special"> <- </span>copy <span class="Constant">0</span> ] </pre> </body> |