about summary refs log tree commit diff stats
path: root/059shape_shifting_recipe.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-13 18:43:00 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-13 18:43:00 -0800
commit1f8713ebe813307ca62e3f9466244e9c7a71fa42 (patch)
tree58557785b1e4f307aed57b74d2e630c6bc976c6f /059shape_shifting_recipe.cc
parente36e7caffa6194135895844aae9df93d1af4b9f9 (diff)
downloadmu-1f8713ebe813307ca62e3f9466244e9c7a71fa42.tar.gz
2433 - temporarily undo 2432
Lessons with Caleb uncovered a problem with type ingredients: I can call
shape-shifting recipes like 'push' from the commandline but not inside
the edit/ or sandbox/ apps.
Diffstat (limited to '059shape_shifting_recipe.cc')
-rw-r--r--059shape_shifting_recipe.cc11
1 files changed, 0 insertions, 11 deletions
diff --git a/059shape_shifting_recipe.cc b/059shape_shifting_recipe.cc
index 7ee400cb..e308be3a 100644
--- a/059shape_shifting_recipe.cc
+++ b/059shape_shifting_recipe.cc
@@ -193,11 +193,6 @@ void save_or_deduce_type_name(reagent& x, map<string, string_tree*>& type_name)
 }
 
 void compute_type_ingredient_mappings(const recipe& exemplar, const instruction& inst, map<string, const string_tree*>& mappings, const recipe& caller_recipe, bool* error) {
-  if (SIZE(exemplar.ingredients) > SIZE(inst.ingredients)) {
-    raise << maybe(caller_recipe.name) << "too few ingredients in call '" << inst.to_string() << "'\n" << end();
-    *error = true;
-    return;
-  }
   for (long long int i = 0; i < SIZE(exemplar.ingredients); ++i) {
     const reagent& exemplar_reagent = exemplar.ingredients.at(i);
     reagent ingredient = inst.ingredients.at(i);
@@ -205,11 +200,6 @@ void compute_type_ingredient_mappings(const recipe& exemplar, const instruction&
     canonize_type(ingredient);
     accumulate_type_ingredients(exemplar_reagent, ingredient, mappings, exemplar, inst, caller_recipe, error);
   }
-  if (SIZE(exemplar.products) > SIZE(inst.products)) {
-    raise << maybe(caller_recipe.name) << "too few products in call '" << inst.to_string() << "'\n" << end();
-    *error = true;
-    return;
-  }
   for (long long int i = 0; i < SIZE(exemplar.products); ++i) {
     const reagent& exemplar_reagent = exemplar.products.at(i);
     reagent product = inst.products.at(i);
@@ -227,7 +217,6 @@ void accumulate_type_ingredients(const reagent& exemplar_reagent, reagent& refin
 void accumulate_type_ingredients(const string_tree* exemplar_type, const string_tree* refinement_type, map<string, const string_tree*>& mappings, const recipe& exemplar, const reagent& exemplar_reagent, const instruction& call_instruction, const recipe& caller_recipe, bool* error) {
   if (!exemplar_type) return;
   if (!refinement_type) {
-    // todo: make this smarter; only warn if exemplar_type contains some *new* type ingredient
     raise_error << maybe(exemplar.name) << "missing type ingredient in " << exemplar_reagent.original_string << '\n' << end();
     return;
   }