From 2b25071710656d7a755c2f66c99734cd7990d1ba Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 26 May 2017 16:43:18 -0700 Subject: 3877 --- 025compare.cc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to '025compare.cc') diff --git a/025compare.cc b/025compare.cc index 0c398655..92878208 100644 --- a/025compare.cc +++ b/025compare.cc @@ -7,18 +7,18 @@ put(Recipe_ordinal, "equal", EQUAL); :(before "End Primitive Recipe Checks") case EQUAL: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(get(Recipe, r).name) << "'equal' needs at least two ingredients to compare in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); break; } const reagent& exemplar = inst.ingredients.at(0); for (int i = /*skip exemplar*/1; i < SIZE(inst.ingredients); ++i) { if (!types_match(inst.ingredients.at(i), exemplar) && !types_match(exemplar, inst.ingredients.at(i))) { - raise << maybe(get(Recipe, r).name) << "'equal' expects ingredients to be all of the same type, but got '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'equal' expects ingredients to be all of the same type, but got '" << to_original_string(inst) << "'\n" << end(); goto finish_checking_instruction; } } if (SIZE(inst.products) > 1) { - raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { @@ -81,16 +81,16 @@ put(Recipe_ordinal, "not-equal", NOT_EQUAL); :(before "End Primitive Recipe Checks") case NOT_EQUAL: { if (SIZE(inst.ingredients) != 2) { - raise << maybe(get(Recipe, r).name) << "'equal' needs two ingredients to compare in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'equal' needs two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); break; } const reagent& exemplar = inst.ingredients.at(0); if (!types_match(inst.ingredients.at(1), exemplar) && !types_match(exemplar, inst.ingredients.at(1))) { - raise << maybe(get(Recipe, r).name) << "'equal' expects ingredients to be all of the same type, but got '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'equal' expects ingredients to be all of the same type, but got '" << to_original_string(inst) << "'\n" << end(); goto finish_checking_instruction; } if (SIZE(inst.products) > 1) { - raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { @@ -135,7 +135,7 @@ put(Recipe_ordinal, "greater-than", GREATER_THAN); :(before "End Primitive Recipe Checks") case GREATER_THAN: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(get(Recipe, r).name) << "'greater-than' needs at least two ingredients to compare in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'greater-than' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); break; } for (int i = 0; i < SIZE(inst.ingredients); ++i) { @@ -145,7 +145,7 @@ case GREATER_THAN: { } } if (SIZE(inst.products) > 1) { - raise << maybe(get(Recipe, r).name) << "'greater-than' yields exactly one product in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'greater-than' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { @@ -202,7 +202,7 @@ put(Recipe_ordinal, "lesser-than", LESSER_THAN); :(before "End Primitive Recipe Checks") case LESSER_THAN: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(get(Recipe, r).name) << "'lesser-than' needs at least two ingredients to compare in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'lesser-than' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); break; } for (int i = 0; i < SIZE(inst.ingredients); ++i) { @@ -212,7 +212,7 @@ case LESSER_THAN: { } } if (SIZE(inst.products) > 1) { - raise << maybe(get(Recipe, r).name) << "'lesser-than' yields exactly one product in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'lesser-than' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { @@ -269,7 +269,7 @@ put(Recipe_ordinal, "greater-or-equal", GREATER_OR_EQUAL); :(before "End Primitive Recipe Checks") case GREATER_OR_EQUAL: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(get(Recipe, r).name) << "'greater-or-equal' needs at least two ingredients to compare in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'greater-or-equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); break; } for (int i = 0; i < SIZE(inst.ingredients); ++i) { @@ -279,7 +279,7 @@ case GREATER_OR_EQUAL: { } } if (SIZE(inst.products) > 1) { - raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { @@ -344,7 +344,7 @@ put(Recipe_ordinal, "lesser-or-equal", LESSER_OR_EQUAL); :(before "End Primitive Recipe Checks") case LESSER_OR_EQUAL: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(get(Recipe, r).name) << "'lesser-or-equal' needs at least two ingredients to compare in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'lesser-or-equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); break; } for (int i = 0; i < SIZE(inst.ingredients); ++i) { @@ -354,7 +354,7 @@ case LESSER_OR_EQUAL: { } } if (SIZE(inst.products) > 1) { - raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { @@ -419,7 +419,7 @@ put(Recipe_ordinal, "max", MAX); :(before "End Primitive Recipe Checks") case MAX: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(get(Recipe, r).name) << "'max' needs at least two ingredients to compare in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'max' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); break; } for (int i = 0; i < SIZE(inst.ingredients); ++i) { @@ -429,7 +429,7 @@ case MAX: { } } if (SIZE(inst.products) > 1) { - raise << maybe(get(Recipe, r).name) << "'max' yields exactly one product in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'max' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_number(inst.products.at(0))) { @@ -458,7 +458,7 @@ put(Recipe_ordinal, "min", MIN); :(before "End Primitive Recipe Checks") case MIN: { if (SIZE(inst.ingredients) <= 1) { - raise << maybe(get(Recipe, r).name) << "'min' needs at least two ingredients to compare in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'min' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); break; } for (int i = 0; i < SIZE(inst.ingredients); ++i) { @@ -468,7 +468,7 @@ case MIN: { } } if (SIZE(inst.products) > 1) { - raise << maybe(get(Recipe, r).name) << "'min' yields exactly one product in '" << inst.original_string << "'\n" << end(); + raise << maybe(get(Recipe, r).name) << "'min' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); break; } if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_number(inst.products.at(0))) { -- cgit 1.4.1-2-gfad0