about summary refs log tree commit diff stats
path: root/024jump.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-04-04 00:18:44 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-04-04 00:18:44 -0700
commite62aa7e305a0ea8ae2c79522588c3bbc80fa4dc3 (patch)
treeaaaf4d8d0010b338fdb59d6eb843fb4b09244dec /024jump.cc
parent2b37bbeae29e55f1456a4540741ceefdb5a0aa4b (diff)
downloadmu-e62aa7e305a0ea8ae2c79522588c3bbc80fa4dc3.tar.gz
3810
Stop naming 'jump' instructions in their errors since they're so often
rewritten from 'break' or 'loop' instructions.

Thanks Lakshman Swaminathan for running into this issue.
Diffstat (limited to '024jump.cc')
-rw-r--r--024jump.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/024jump.cc b/024jump.cc
index 8b33a083..734cfc49 100644
--- a/024jump.cc
+++ b/024jump.cc
@@ -16,11 +16,11 @@ put(Recipe_ordinal, "jump", JUMP);
 :(before "End Primitive Recipe Checks")
 case JUMP: {
   if (SIZE(inst.ingredients) != 1) {
-    raise << maybe(get(Recipe, r).name) << "'jump' requires exactly one ingredient, but got '" << inst.original_string << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'" << inst.original_string << "' should get exactly one ingredient\n" << end();
     break;
   }
   if (!is_literal(inst.ingredients.at(0))) {
-    raise << maybe(get(Recipe, r).name) << "first ingredient of 'jump' should be a label or offset, but got '" << inst.ingredients.at(0).original_string << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "first ingredient of '" << inst.original_string << "' should be a label or offset, but '" << inst.ingredients.at(0).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(0).type) << "'\n" << end();
     break;
   }
   break;
@@ -55,15 +55,15 @@ put(Recipe_ordinal, "jump-if", JUMP_IF);
 :(before "End Primitive Recipe Checks")
 case JUMP_IF: {
   if (SIZE(inst.ingredients) != 2) {
-    raise << maybe(get(Recipe, r).name) << "'jump-if' requires exactly two ingredients, but got '" << inst.original_string << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'" << inst.original_string << "' should get exactly two ingredients\n" << end();
     break;
   }
   if (!is_mu_scalar(inst.ingredients.at(0))) {
-    raise << maybe(get(Recipe, r).name) << "'jump-if' requires a boolean for its first ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'" << inst.original_string << "' requires a boolean for its first ingredient, but '" << inst.ingredients.at(0).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(0).type) << "'\n" << end();
     break;
   }
   if (!is_literal(inst.ingredients.at(1))) {
-    raise << maybe(get(Recipe, r).name) << "'jump-if' requires a label or offset for its second ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'" << inst.original_string << "' requires a label or offset for its second ingredient, but '" << inst.ingredients.at(1).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(1).type) << "'\n" << end();
     break;
   }
   // End JUMP_IF Checks
@@ -108,15 +108,15 @@ put(Recipe_ordinal, "jump-unless", JUMP_UNLESS);
 :(before "End Primitive Recipe Checks")
 case JUMP_UNLESS: {
   if (SIZE(inst.ingredients) != 2) {
-    raise << maybe(get(Recipe, r).name) << "'jump-unless' requires exactly two ingredients, but got '" << inst.original_string << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'" << inst.original_string << "' should get exactly two ingredients\n" << end();
     break;
   }
   if (!is_mu_scalar(inst.ingredients.at(0))) {
-    raise << maybe(get(Recipe, r).name) << "'jump-unless' requires a boolean for its first ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'" << inst.original_string << "' requires a boolean for its first ingredient, but '" << inst.ingredients.at(0).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(0).type) << "'\n" << end();
     break;
   }
   if (!is_literal(inst.ingredients.at(1))) {
-    raise << maybe(get(Recipe, r).name) << "'jump-unless' requires a label or offset for its second ingredient, but got '" << inst.ingredients.at(0).original_string << "'\n" << end();
+    raise << maybe(get(Recipe, r).name) << "'" << inst.original_string << "' requires a label or offset for its second ingredient, but '" << inst.ingredients.at(1).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(1).type) << "'\n" << end();
     break;
   }
   // End JUMP_UNLESS Checks