diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-11-06 22:41:02 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-11-06 22:41:02 -0800 |
commit | 133a4614365bbcc74602284beedc7b274fcf3e24 (patch) | |
tree | f4c08bb926573a799a2b7031aaa3a1f992461bf8 /html/017parse_tree.cc.html | |
parent | 704716286242e65375595fe30742f1c3fd8123a0 (diff) | |
download | mu-133a4614365bbcc74602284beedc7b274fcf3e24.tar.gz |
3642
Diffstat (limited to 'html/017parse_tree.cc.html')
-rw-r--r-- | html/017parse_tree.cc.html | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/html/017parse_tree.cc.html b/html/017parse_tree.cc.html index f700033e..39f56afb 100644 --- a/html/017parse_tree.cc.html +++ b/html/017parse_tree.cc.html @@ -115,6 +115,7 @@ string_tree* parse_string_tree<span class="Delimiter">(</span>istream& in<sp <span class="Delimiter">}</span> in<span class="Delimiter">.</span>get<span class="Delimiter">();</span> <span class="Comment">// skip ')'</span> assert<span class="Delimiter">(</span>*curr == <span class="Constant">NULL</span><span class="Delimiter">);</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>result == <span class="Constant">NULL</span><span class="Delimiter">)</span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span class="Normal">if</span> <span class="Delimiter">(</span>result<span class="Delimiter">-></span>right == <span class="Constant">NULL</span><span class="Delimiter">)</span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span class="Comment">// standardize the final element to always be on the right if it's an atom</span> <span class="Comment">// (a b c) => (a b . c) in s-expression parlance</span> @@ -142,6 +143,12 @@ string_tree* parse_string_tree<span class="Delimiter">(</span>istream& in<sp ] <span class="traceContains">+parse: product: {1: ("foo" ("address" "array" "character") ("bar" "number"))}</span> +<span class="Delimiter">:(scenario dilated_empty_tree)</span> +<span class="muRecipe">def</span> main [ + <span class="Delimiter">{</span><span class="Constant">1</span>: number<span class="Delimiter">,</span> foo: <span class="Delimiter">()}</span><span class="Special"> <- </span>copy <span class="Constant">34</span> +] +<span class="traceContains">+parse: product: {1: "number", "foo": ()}</span> + <span class="Delimiter">:(scenario dilated_singleton_tree)</span> <span class="muRecipe">def</span> main [ <span class="Delimiter">{</span><span class="Constant">1</span>: number<span class="Delimiter">,</span> foo: <span class="Delimiter">(</span>bar<span class="Delimiter">)}</span><span class="Special"> <- </span>copy <span class="Constant">34</span> |