From a2a20225264e242f88d2e95f9e824597bd1184b3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 6 Nov 2016 01:24:19 -0700 Subject: 3632 Follow-up to commit 3628. --- 017parse_tree.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '017parse_tree.cc') 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 -- cgit 1.4.1-2-gfad0