about summary refs log tree commit diff stats
path: root/025compare.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-05-26 16:43:18 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-05-26 17:36:16 -0700
commit2b25071710656d7a755c2f66c99734cd7990d1ba (patch)
treef4e3a83d6397343c7c225a354f4f2c837aef8190 /025compare.cc
parent5e320aa049bc1d5ad78eec23be0127f4a8d6ec3d (diff)
downloadmu-2b25071710656d7a755c2f66c99734cd7990d1ba.tar.gz
3877
Diffstat (limited to '025compare.cc')
-rw-r--r--025compare.cc36
1 files changed, 18 insertions, 18 deletions
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))) {