From 9f73b16511406dd8281b615b138d8648e854ca52 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 28 Mar 2016 00:00:44 -0700 Subject: 2817 --- 057shape_shifting_container.cc | 46 ------------------------------------------ 1 file changed, 46 deletions(-) (limited to '057shape_shifting_container.cc') diff --git a/057shape_shifting_container.cc b/057shape_shifting_container.cc index 613aaaa7..80cd43b7 100644 --- a/057shape_shifting_container.cc +++ b/057shape_shifting_container.cc @@ -126,32 +126,6 @@ def main [ +mem: storing 23 in location 7 $mem: 7 -:(code) -// shape-shifting version of size_of -int size_of_type_ingredient(const type_tree* element_template, const type_tree* rest_of_use) { - type_tree* element_type = type_ingredient(element_template, rest_of_use); - if (!element_type) return 0; - int result = size_of(element_type); - delete element_type; - return result; -} - -type_tree* type_ingredient(const type_tree* element_template, const type_tree* rest_of_use) { - int type_ingredient_index = element_template->value - START_TYPE_INGREDIENTS; - const type_tree* curr = rest_of_use; - if (!curr) return NULL; - while (type_ingredient_index > 0) { - --type_ingredient_index; - curr = curr->right; - if (!curr) return NULL; - } - assert(curr); - if (curr->left) curr = curr->left; - assert(curr->value > 0); - trace(9999, "type") << "type deduced to be " << get(Type, curr->value).name << "$" << end(); - return new type_tree(*curr); -} - :(scenario get_on_shape_shifting_container) container foo:_t [ x:_t @@ -163,16 +137,6 @@ def main [ ] +mem: storing 16 in location 2 -:(before "End GET field Cases") -const type_tree* type = get(Type, base_type).elements.at(i).type; -if (type->value >= START_TYPE_INGREDIENTS) { - int size = size_of_type_ingredient(type, base.type->right); - if (!size) - raise << "illegal field type '" << to_string(type) << "' seems to be missing a type ingredient or three\n" << end(); - src += size; - continue; -} - :(scenario get_on_shape_shifting_container_2) container foo:_t [ x:_t @@ -508,16 +472,6 @@ def main [ ] +mem: storing 12 in location 1 -:(before "End GET_ADDRESS field Cases") -const type_tree* type = get(Type, base_type).elements.at(i).type; -if (type->value >= START_TYPE_INGREDIENTS) { - int size = size_of_type_ingredient(type, base.type->right); - if (!size) - raise << "illegal type '" << to_string(type) << "' seems to be missing a type ingredient or three\n" << end(); - result += size; - continue; -} - //: 'merge' on shape-shifting containers :(scenario merge_check_shape_shifting_container_containing_exclusive_container) -- cgit 1.4.1-2-gfad0