about summary refs log tree commit diff stats
path: root/017parse_tree.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-11-06 01:24:19 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-11-06 01:24:19 -0700
commita2a20225264e242f88d2e95f9e824597bd1184b3 (patch)
treeb84887c1ee20dad93f8206e6a9693ddd6cd41684 /017parse_tree.cc
parentc5ee24ef524a4d90cd5fbf0aa22a137396f5306c (diff)
downloadmu-a2a20225264e242f88d2e95f9e824597bd1184b3.tar.gz
3632
Follow-up to commit 3628.
Diffstat (limited to '017parse_tree.cc')
-rw-r--r--017parse_tree.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/017parse_tree.cc b/017parse_tree.cc
index 50499a7c..6d84f898 100644
--- a/017parse_tree.cc
+++ b/017parse_tree.cc
@@ -79,6 +79,7 @@ string_tree* parse_string_tree(istream& in) {
   }
   in.get();  // skip ')'
   assert(*curr == NULL);
+  if (result == NULL) return result;
   if (result->right == NULL) return result;
   // standardize the final element to always be on the right if it's an atom
   // (a b c) => (a b . c) in s-expression parlance
@@ -106,6 +107,12 @@ container bar [
 ]
 +parse:   product: {1: ("foo" ("address" "array" "character") ("bar" "number"))}
 
+:(scenario dilated_empty_tree)
+def main [
+  {1: number, foo: ()} <- copy 34
+]
++parse:   product: {1: "number", "foo": ()}
+
 :(scenario dilated_singleton_tree)
 def main [
   {1: number, foo: (bar)} <- copy 34