diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-07-05 01:08:00 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-07-05 01:08:00 -0700 |
commit | 298f8065857630e414d84e4ee785a6d17e5f99bb (patch) | |
tree | 8880a092ab59850a6f821ba892f3904ab464431c /html/010vm.cc.html | |
parent | f28f2636c6707e1a33bebacafd0486f4965978ea (diff) | |
download | mu-298f8065857630e414d84e4ee785a6d17e5f99bb.tar.gz |
3102
Diffstat (limited to 'html/010vm.cc.html')
-rw-r--r-- | html/010vm.cc.html | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/html/010vm.cc.html b/html/010vm.cc.html index a2a4c926..508f7483 100644 --- a/html/010vm.cc.html +++ b/html/010vm.cc.html @@ -111,9 +111,11 @@ recipe_ordinal Next_recipe_ordinal = <span class="Constant">1</span><span class= ~type_tree<span class="Delimiter">();</span> type_tree<span class="Delimiter">(</span><span class="Normal">const</span> type_tree& old<span class="Delimiter">);</span> <span class="Comment">// simple: type ordinal</span> - <span class="Normal">explicit</span> type_tree<span class="Delimiter">(</span>string name<span class="Delimiter">,</span> type_ordinal v<span class="Delimiter">)</span> :name<span class="Delimiter">(</span>name<span class="Delimiter">),</span> value<span class="Delimiter">(</span>v<span class="Delimiter">),</span> left<span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">),</span> right<span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">)</span> <span class="Delimiter">{}</span> + <span class="Normal">explicit</span> type_tree<span class="Delimiter">(</span>string name<span class="Delimiter">);</span> + type_tree<span class="Delimiter">(</span>string name<span class="Delimiter">,</span> type_ordinal v<span class="Delimiter">)</span> :name<span class="Delimiter">(</span>name<span class="Delimiter">),</span> value<span class="Delimiter">(</span>v<span class="Delimiter">),</span> left<span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">),</span> right<span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">)</span> <span class="Delimiter">{}</span> <span class="Comment">// intermediate: list of type ordinals</span> type_tree<span class="Delimiter">(</span>string name<span class="Delimiter">,</span> type_ordinal v<span class="Delimiter">,</span> type_tree* r<span class="Delimiter">)</span> :name<span class="Delimiter">(</span>name<span class="Delimiter">),</span> value<span class="Delimiter">(</span>v<span class="Delimiter">),</span> left<span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">),</span> right<span class="Delimiter">(</span>r<span class="Delimiter">)</span> <span class="Delimiter">{}</span> + type_tree<span class="Delimiter">(</span>string name<span class="Delimiter">,</span> type_tree* r<span class="Delimiter">);</span> <span class="Comment">// advanced: tree containing type ordinals</span> type_tree<span class="Delimiter">(</span>type_tree* l<span class="Delimiter">,</span> type_tree* r<span class="Delimiter">)</span> :value<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">),</span> left<span class="Delimiter">(</span>l<span class="Delimiter">),</span> right<span class="Delimiter">(</span>r<span class="Delimiter">)</span> <span class="Delimiter">{}</span> <span class="Delimiter">};</span> @@ -133,6 +135,9 @@ recipe_ordinal Next_recipe_ordinal = <span class="Constant">1</span><span class= <span class="Delimiter">};</span> <span class="Comment">// End type_tree Definition</span> +<span class="Delimiter">:(code)</span> +type_tree::type_tree<span class="Delimiter">(</span>string name<span class="Delimiter">)</span> :name<span class="Delimiter">(</span>name<span class="Delimiter">),</span> value<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> name<span class="Delimiter">)),</span> left<span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">),</span> right<span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">)</span> <span class="Delimiter">{}</span> +type_tree::type_tree<span class="Delimiter">(</span>string name<span class="Delimiter">,</span> type_tree* r<span class="Delimiter">)</span> :name<span class="Delimiter">(</span>name<span class="Delimiter">),</span> value<span class="Delimiter">(</span>get<span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> name<span class="Delimiter">)),</span> left<span class="Delimiter">(</span><span class="Constant">NULL</span><span class="Delimiter">),</span> right<span class="Delimiter">(</span>r<span class="Delimiter">)</span> <span class="Delimiter">{}</span> <span class="Delimiter">:(before "End Globals")</span> <span class="Comment">// Locations refer to a common 'memory'. Each location can store a number.</span> @@ -305,9 +310,9 @@ reagent::reagent<span class="Delimiter">(</span><span class="Normal">const</span <span class="Normal">delete</span> type_names<span class="Delimiter">;</span> <span class="Comment">// special cases</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_integer<span class="Delimiter">(</span>name<span class="Delimiter">)</span> && type == <span class="Constant">NULL</span><span class="Delimiter">)</span> - type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Constant">"literal"</span><span class="Delimiter">,</span> get<span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> <span class="Constant">"literal"</span><span class="Delimiter">));</span> + type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Constant">"literal"</span><span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>name == <span class="Constant">"_"</span> && type == <span class="Constant">NULL</span><span class="Delimiter">)</span> - type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Constant">"literal"</span><span class="Delimiter">,</span> get<span class="Delimiter">(</span>Type_ordinal<span class="Delimiter">,</span> <span class="Constant">"literal"</span><span class="Delimiter">));</span> + type = <span class="Normal">new</span> type_tree<span class="Delimiter">(</span><span class="Constant">"literal"</span><span class="Delimiter">);</span> <span class="Comment">// other properties</span> slurp_properties<span class="Delimiter">(</span>in<span class="Delimiter">,</span> properties<span class="Delimiter">);</span> <span class="Comment">// End Parsing reagent</span> @@ -463,8 +468,7 @@ string_tree* property<span class="Delimiter">(</span><span class="Normal">const< <span class="Delimiter">}</span> <span class="SalientComment">//:: Helpers for converting various values to string</span> -<span class="Comment">//: Use to_string() in trace(), and try to avoid relying on unstable codes that</span> -<span class="Comment">//: will perturb .traces/ from commit to commit.</span> +<span class="Comment">//: Use to_string() in trace(), and try to keep it stable from run to run.</span> <span class="Comment">//: Use debug_string() while debugging, and throw everything into it.</span> <span class="Comment">//: Use inspect() only for emitting a canonical format that can be parsed back</span> <span class="Comment">//: into the value.</span> @@ -705,9 +709,9 @@ string trim_floating_point<span class="Delimiter">(</span><span class="Normal">c <span class="Delimiter">}</span> <span class="Delimiter">:(before "End Includes")</span> -<span class="PreProc">#include</span><span class="Constant"><utility></span> +<span class="PreProc">#include </span><span class="Constant"><utility></span> <span class="Normal">using</span> std::pair<span class="Delimiter">;</span> -<span class="PreProc">#include</span><span class="Constant"><math.h></span> +<span class="PreProc">#include </span><span class="Constant"><math.h></span> </pre> </body> </html> |