diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-05-24 20:06:13 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-05-24 20:06:13 -0700 |
commit | 6b59e98683a0311794cf8bb6f59766bb85c33d8f (patch) | |
tree | dbcded4e56337be751095094c94504ed38c465db | |
parent | ba7b4f643defaba112bdd6e098f4ff4ed5129315 (diff) | |
download | mu-6b59e98683a0311794cf8bb6f59766bb85c33d8f.tar.gz |
3006
-rw-r--r-- | 054static_dispatch.cc | 10 | ||||
-rw-r--r-- | 056shape_shifting_recipe.cc | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/054static_dispatch.cc b/054static_dispatch.cc index 106c757a..dd9fc84b 100644 --- a/054static_dispatch.cc +++ b/054static_dispatch.cc @@ -274,10 +274,8 @@ bool all_header_reagents_strictly_match_except_literal_zero_against_address(cons } bool types_strictly_match_except_literal_zero_against_address(const reagent& to, const reagent& from) { - // to sidestep type-checking, use /unsafe in the source. - // this will be highlighted in red inside vim. just for setting up some tests. if (is_literal(from) && is_mu_address(to)) - return from.name == "0" && !contains_type_ingredient_name(to); + return from.name == "0"; return types_strictly_match(to, from); } @@ -311,14 +309,10 @@ bool all_header_reagents_strictly_match_except_literal_against_address_or_boolea } bool types_strictly_match_except_literal_against_address_or_boolean(const reagent& to, const reagent& from) { - // to sidestep type-checking, use /unsafe in the source. - // this will be highlighted in red inside vim. just for setting up some tests. if (is_literal(from) && to.type && to.type->value == get(Type_ordinal, "boolean")) return boolean_matches_literal(to, from); - if (is_literal(from) && is_mu_address(to)) - return from.name == "0" && !contains_type_ingredient_name(to); - return types_strictly_match(to, from); + return types_strictly_match_except_literal_zero_against_address(to, from); } // phase 5 diff --git a/056shape_shifting_recipe.cc b/056shape_shifting_recipe.cc index 70a464e0..74b6c53f 100644 --- a/056shape_shifting_recipe.cc +++ b/056shape_shifting_recipe.cc @@ -83,6 +83,13 @@ if (contains_key(Recipe, inst.operation) && inst.operation >= MAX_PRIMITIVE_RECI return; } +:(replace{} "bool types_strictly_match_except_literal_zero_against_address(const reagent& to, const reagent& from)") +bool types_strictly_match_except_literal_zero_against_address(const reagent& to, const reagent& from) { + if (is_literal(from) && is_mu_address(to)) + return from.name == "0" && !contains_type_ingredient_name(to); + return types_strictly_match(to, from); +} + :(code) // phase 2 of static dispatch vector<recipe_ordinal> strictly_matching_shape_shifting_variants(const instruction& inst, vector<recipe_ordinal>& variants) { |