about summary refs log tree commit diff stats
path: root/html/017parse_tree.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-11-06 22:41:02 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-11-06 22:41:02 -0800
commit133a4614365bbcc74602284beedc7b274fcf3e24 (patch)
treef4c08bb926573a799a2b7031aaa3a1f992461bf8 /html/017parse_tree.cc.html
parent704716286242e65375595fe30742f1c3fd8123a0 (diff)
downloadmu-133a4614365bbcc74602284beedc7b274fcf3e24.tar.gz
3642
Diffstat (limited to 'html/017parse_tree.cc.html')
-rw-r--r--html/017parse_tree.cc.html7
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&amp; 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">-&gt;</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) =&gt; (a b . c) in s-expression parlance</span>
@@ -142,6 +143,12 @@ string_tree* parse_string_tree<span class="Delimiter">(</span>istream&amp; in<sp
 ]
 <span class="traceContains">+parse:   product: {1: (&quot;foo&quot; (&quot;address&quot; &quot;array&quot; &quot;character&quot;) (&quot;bar&quot; &quot;number&quot;))}</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"> &lt;- </span>copy <span class="Constant">34</span>
+]
+<span class="traceContains">+parse:   product: {1: &quot;number&quot;, &quot;foo&quot;: ()}</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"> &lt;- </span>copy <span class="Constant">34</span>