about summary refs log tree commit diff stats
path: root/035call_ingredient.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-27 22:01:23 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-27 22:03:58 -0800
commit016599f1d2f861a5c36e6f88c05c98ef88e0ee85 (patch)
tree2a6019bf69a4764a0c7204f5904c9ffd84dff77c /035call_ingredient.cc
parentfca48e92d4e51eb7e5b1a811b65e5d69fadeb713 (diff)
downloadmu-016599f1d2f861a5c36e6f88c05c98ef88e0ee85.tar.gz
2484
Eliminate one of several hacky type-check helpers; they've been
proliferating lately.
Diffstat (limited to '035call_ingredient.cc')
-rw-r--r--035call_ingredient.cc11
1 files changed, 3 insertions, 8 deletions
diff --git a/035call_ingredient.cc b/035call_ingredient.cc
index 919320ea..2f28c8f7 100644
--- a/035call_ingredient.cc
+++ b/035call_ingredient.cc
@@ -22,7 +22,7 @@ recipe f [
 
 :(before "End call Fields")
 vector<vector<double> > ingredient_atoms;
-vector<type_tree*> ingredient_types;
+vector<reagent> ingredients;
 long long int next_ingredient_to_process;
 :(before "End call Constructor")
 next_ingredient_to_process = 0;
@@ -32,13 +32,9 @@ for (long long int i = 0; i < SIZE(ingredients); ++i) {
   current_call().ingredient_atoms.push_back(ingredients.at(i));
   reagent ingredient = call_instruction.ingredients.at(i);
   canonize_type(ingredient);
-  current_call().ingredient_types.push_back(ingredient.type);
+  current_call().ingredients.push_back(ingredient);
   ingredient.type = NULL;  // release long-lived pointer
 }
-:(before "End call Destructor")
-for (long long int i = 0; i < SIZE(ingredient_types); ++i) {
-  delete ingredient_types.at(i);
-}
 
 :(before "End Primitive Recipe Declarations")
 NEXT_INGREDIENT,
@@ -65,8 +61,7 @@ case NEXT_INGREDIENT: {
         raise_error << "main: wrong type for ingredient " << product.original_string << '\n' << end();
     }
     else if (!types_match(product,
-                          current_call().ingredient_types.at(current_call().next_ingredient_to_process),
-                          current_call().ingredient_atoms.at(current_call().next_ingredient_to_process))) {
+                          current_call().ingredients.at(current_call().next_ingredient_to_process))) {
       raise_error << maybe(current_recipe_name()) << "wrong type for ingredient " << product.original_string << '\n' << end();
     }
     products.push_back(