diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-11-15 12:47:48 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-11-15 12:47:48 -0800 |
commit | d2bd40bfcb995fecb947035b0c896342ca22cdd6 (patch) | |
tree | 857614acd1cde9992d3c5518a363ca8c1ff30281 /html/010vm.cc.html | |
parent | 741ef43e4ce57d59b6ae8267fde9135cb70bb79d (diff) | |
download | mu-d2bd40bfcb995fecb947035b0c896342ca22cdd6.tar.gz |
2447
Diffstat (limited to 'html/010vm.cc.html')
-rw-r--r-- | html/010vm.cc.html | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/html/010vm.cc.html b/html/010vm.cc.html index 20c502ba..f476aa61 100644 --- a/html/010vm.cc.html +++ b/html/010vm.cc.html @@ -467,11 +467,11 @@ string instruction::to_string<span class="Delimiter">()</span> const <span class string debug_string<span class="Delimiter">(</span>const recipe& x<span class="Delimiter">)</span> <span class="Delimiter">{</span> ostringstream out<span class="Delimiter">;</span> - out << <span class="Constant">"recipe "</span> << x<span class="Delimiter">.</span>name << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> + out << <span class="Constant">"- recipe "</span> << x<span class="Delimiter">.</span>name << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> <span class="Comment">// Begin debug_string(recipe x)</span> for <span class="Delimiter">(</span>long long int index = <span class="Constant">0</span><span class="Delimiter">;</span> index < SIZE<span class="Delimiter">(</span>x<span class="Delimiter">.</span>steps<span class="Delimiter">);</span> ++index<span class="Delimiter">)</span> <span class="Delimiter">{</span> const instruction& inst = x<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span>index<span class="Delimiter">);</span> - out << <span class="Constant">" inst: "</span> << inst<span class="Delimiter">.</span>to_string<span class="Delimiter">()</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> + out << <span class="Constant">"inst: "</span> << inst<span class="Delimiter">.</span>to_string<span class="Delimiter">()</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> out << <span class="Constant">" ingredients</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">;</span> for <span class="Delimiter">(</span>long long int i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> out << <span class="Constant">" "</span> << debug_string<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> @@ -518,6 +518,23 @@ bool deeply_equal<span class="Delimiter">(</span>const string_tree* a<span class && deeply_equal<span class="Delimiter">(</span>a<span class="Delimiter">-></span>right<span class="Delimiter">,</span> b<span class="Delimiter">-></span>right<span class="Delimiter">);</span> <span class="Delimiter">}</span> +<span class="Delimiter">:(before "End Globals")</span> +set<string> Literal_type_names<span class="Delimiter">;</span> +<span class="Delimiter">:(before "End One-time Setup")</span> +Literal_type_names<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"literal"</span><span class="Delimiter">);</span> +Literal_type_names<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"number"</span><span class="Delimiter">);</span> +Literal_type_names<span class="Delimiter">.</span>insert<span class="Delimiter">(</span><span class="Constant">"character"</span><span class="Delimiter">);</span> +<span class="Delimiter">:(code)</span> +bool deeply_equal_types<span class="Delimiter">(</span>const string_tree* a<span class="Delimiter">,</span> const string_tree* b<span class="Delimiter">)</span> <span class="Delimiter">{</span> + if <span class="Delimiter">(</span>!a<span class="Delimiter">)</span> <span class="Identifier">return</span> !b<span class="Delimiter">;</span> + if <span class="Delimiter">(</span>!b<span class="Delimiter">)</span> <span class="Identifier">return</span> !a<span class="Delimiter">;</span> + if <span class="Delimiter">(</span>Literal_type_names<span class="Delimiter">.</span>find<span class="Delimiter">(</span>a<span class="Delimiter">-></span>value<span class="Delimiter">)</span> != Literal_type_names<span class="Delimiter">.</span>end<span class="Delimiter">())</span> + <span class="Identifier">return</span> Literal_type_names<span class="Delimiter">.</span>find<span class="Delimiter">(</span>b<span class="Delimiter">-></span>value<span class="Delimiter">)</span> != Literal_type_names<span class="Delimiter">.</span>end<span class="Delimiter">();</span> + <span class="Identifier">return</span> a<span class="Delimiter">-></span>value == b<span class="Delimiter">-></span>value + && deeply_equal_types<span class="Delimiter">(</span>a<span class="Delimiter">-></span>left<span class="Delimiter">,</span> b<span class="Delimiter">-></span>left<span class="Delimiter">)</span> + && deeply_equal_types<span class="Delimiter">(</span>a<span class="Delimiter">-></span>right<span class="Delimiter">,</span> b<span class="Delimiter">-></span>right<span class="Delimiter">);</span> +<span class="Delimiter">}</span> + void dump_memory<span class="Delimiter">()</span> <span class="Delimiter">{</span> for <span class="Delimiter">(</span>map<long long int<span class="Delimiter">,</span> double>::iterator p = Memory<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Memory<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> cout << p<span class="Delimiter">-></span>first << <span class="Constant">": "</span> << no_scientific<span class="Delimiter">(</span>p<span class="Delimiter">-></span>second<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> |