about summary refs log tree commit diff stats
path: root/030container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-07-21 19:22:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-07-21 19:22:03 -0700
commit8d72e5652147a0218f36757fd9171f3f2beda887 (patch)
treeb95edd6bb86f7d421327d2f436e0c2d375cb795d /030container.cc
parentfc19980d91e306df87b308d0c2875a2dcaf4b5c7 (diff)
downloadmu-8d72e5652147a0218f36757fd9171f3f2beda887.tar.gz
3120
Always show instruction before any transforms in error messages.

This is likely going to make some errors unclear because they *need* to
show the original instruction. But if we don't have tests for those
situations did they ever really work?
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/030container.cc b/030container.cc
index e22fe4be..56cae250 100644
--- a/030container.cc
+++ b/030container.cc
@@ -263,7 +263,7 @@ put(Recipe_ordinal, "get", GET);
 :(before "End Primitive Recipe Checks")
 case GET: {
   if (SIZE(inst.ingredients) != 2) {
-    raise << maybe(get(Recipe, r).name) << "'get' expects exactly 2 ingredients in '" << to_original_string(inst) << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'get' expects exactly 2 ingredients in '" << inst.original_string << "'\n" << end();
     break;
   }
   reagent/*copy*/ base = inst.ingredients.at(0);  // new copy for every invocation
@@ -401,7 +401,7 @@ put(Recipe_ordinal, "put", PUT);
 :(before "End Primitive Recipe Checks")
 case PUT: {
   if (SIZE(inst.ingredients) != 3) {
-    raise << maybe(get(Recipe, r).name) << "'put' expects exactly 3 ingredients in '" << to_original_string(inst) << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'put' expects exactly 3 ingredients in '" << inst.original_string << "'\n" << end();
     break;
   }
   reagent/*copy*/ base = inst.ingredients.at(0);
@@ -672,9 +672,9 @@ void check_or_set_invalid_types(const recipe_ordinal r) {
   for (int index = 0; index < SIZE(caller.steps); ++index) {
     instruction& inst = caller.steps.at(index);
     for (int i = 0; i < SIZE(inst.ingredients); ++i)
-      check_or_set_invalid_types(inst.ingredients.at(i).type, maybe(caller.name), "'"+to_original_string(inst)+"'");
+      check_or_set_invalid_types(inst.ingredients.at(i).type, maybe(caller.name), "'"+inst.original_string+"'");
     for (int i = 0; i < SIZE(inst.products); ++i)
-      check_or_set_invalid_types(inst.products.at(i).type, maybe(caller.name), "'"+to_original_string(inst)+"'");
+      check_or_set_invalid_types(inst.products.at(i).type, maybe(caller.name), "'"+inst.original_string+"'");
   }
   // End check_or_set_invalid_types
 }