about summary refs log tree commit diff stats
path: root/030container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-21 23:38:21 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-21 23:38:21 -0700
commit4efc0ff3168f9ff6e80b2fa4b3302baac4035abb (patch)
tree83843682dfa136f08f7a3603902d39f8b76c10b5 /030container.cc
parentefc5c081304f7da0d8ffcc863f14922845d04295 (diff)
downloadmu-4efc0ff3168f9ff6e80b2fa4b3302baac4035abb.tar.gz
1826 - edit: start carefully showing all errors
Eventually we might be able to get rid of die entirely.

This is just a preliminary stab at a random error. In the process I ran
into two issues that have impeded debugging before:

a) Naming conflicts within scenarios are a real no-no. I need to warn on
them, but the rules are getting complicated:
  Always print warnings on redefine
  But not in interactive mode
  Or in scenarios checking warning behavior
  Unless the scenario recipe itself is overridden

b) Now that we've added collect_layers and a long time can go between
traces, debugging is a minefield because trace lines don't print to
screen immediately after they're created. Need to do something about
that. Maybe explicitly trigger collection by tracing '\n' or something.

These are the next two items on my todo list.
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/030container.cc b/030container.cc
index f90e92ba..c49aa877 100644
--- a/030container.cc
+++ b/030container.cc
@@ -107,8 +107,10 @@ case GET: {
   reagent base = current_instruction().ingredients.at(0);
   long long int base_address = base.value;
   type_ordinal base_type = base.types.at(0);
-  if (Type[base_type].kind != container)
-    raise << "'get' on a non-container in " << current_recipe_name () << ": " << current_instruction().to_string() << '\n' << die();
+  if (Type[base_type].kind != container) {
+    raise << current_recipe_name () << ": 'get' on a non-container " << base.original_string << '\n';
+    break;
+  }
   assert(is_literal(current_instruction().ingredients.at(1)));
   assert(scalar(ingredients.at(1)));
   long long int offset = ingredients.at(1).at(0);