From d009e158803956c76adbf8f58a62884c3e7affb3 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 26 Jan 2016 23:47:23 -0800 Subject: 2605 --- html/010vm.cc.html | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'html/010vm.cc.html') diff --git a/html/010vm.cc.html b/html/010vm.cc.html index 69d5dec0..40ae0c5e 100644 --- a/html/010vm.cc.html +++ b/html/010vm.cc.html @@ -282,14 +282,14 @@ reagent::reagent(string s name = properties.at(0).first; type = new_type_tree(properties.at(0).second); if (is_integer(name) && type == NULL) { - type = new type_tree(0); assert(!properties.at(0).second); properties.at(0).second = new string_tree("literal"); + type = new type_tree(get(Type_ordinal, "literal")); } if (name == "_" && type == NULL) { - type = new type_tree(0); assert(!properties.at(0).second); properties.at(0).second = new string_tree("dummy"); + type = new type_tree(get(Type_ordinal, "literal")); } // End Parsing reagent } @@ -311,7 +311,7 @@ type_tree* new_type_tree(const string_tree* prope result->value = get(Type_ordinal, type_name); else if (is_integer(type_name)) // sometimes types will contain non-type tags, like numbers for the size of an array result->value = 0; - else + else if (properties->value != "->") // used in recipe types result->value = -1; // should never happen; will trigger errors later } result->left = new_type_tree(properties->left); @@ -321,7 +321,11 @@ type_tree* new_type_tree(const string_tree* prope //: avoid memory leaks for the type tree -reagent::reagent(const reagent& old) :original_string(old.original_string), properties(old.properties), name(old.name), value(old.value), initialized(old.initialized) { +reagent::reagent(const reagent& old) { + original_string = old.original_string; + name = old.name; + value = old.value; + initialized = old.initialized; properties.clear(); for (long long int i = 0; i < SIZE(old.properties); ++i) { properties.push_back(pair<string, string_tree*>(old.properties.at(i).first, @@ -330,7 +334,8 @@ reagent::reagent(const reagent& old.type ? new type_tree(*old.type) : NULL; } -type_tree::type_tree(const type_tree& old) :value(old.value) { +type_tree::type_tree(const type_tree& old) { + value = old.value; left = old.left ? new type_tree(*old.left) : NULL; right = old.right ? new type_tree(*old.right) : NULL; } -- cgit 1.4.1-2-gfad0