From 1f8713ebe813307ca62e3f9466244e9c7a71fa42 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 13 Nov 2015 18:43:00 -0800 Subject: 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. --- 059shape_shifting_recipe.cc | 11 ----------- 1 file changed, 11 deletions(-) (limited to '059shape_shifting_recipe.cc') 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& type_name) } void compute_type_ingredient_mappings(const recipe& exemplar, const instruction& inst, map& 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& 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; } -- cgit 1.4.1-2-gfad0 ass='path'>path: root/cpp/.traces/break_nested_degenerate
blob: e68442d3d88a704571b432b0224439e460055471 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23