about summary refs log tree commit diff stats
path: root/011load.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-10-29 17:15:09 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-29 17:15:09 -0700
commite6692482643dc007988188e2b19fbb9219ca2833 (patch)
treecbb805cba3bd46dfc7d71adaa2150d9acb5cc5ba /011load.cc
parent5a702544a6f8aa3fa520ba387a6c0e803e076476 (diff)
downloadmu-e6692482643dc007988188e2b19fbb9219ca2833.tar.gz
2321 - more preparations for static dispatch
Deduce operation id from name during transform rather than load, so that
earlier transforms have a chance to modify the name.
Diffstat (limited to '011load.cc')
-rw-r--r--011load.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/011load.cc b/011load.cc
index 2ac517c5..d848fd55 100644
--- a/011load.cc
+++ b/011load.cc
@@ -134,15 +134,8 @@ bool next_instruction(istream& in, instruction* curr) {
     raise_error << "instruction prematurely ended with '<-'\n" << end();
     return false;
   }
-  curr->name = *p;
-  if (Recipe_ordinal.find(*p) == Recipe_ordinal.end()) {
-    Recipe_ordinal[*p] = Next_recipe_ordinal++;
-  }
-  if (Recipe_ordinal[*p] == 0) {
-    raise_error << "Recipe " << *p << " has number 0, which is reserved for IDLE.\n" << end();
-    return false;
-  }
-  curr->operation = Recipe_ordinal[*p];  ++p;
+  curr->old_name = curr->name = *p;  p++;
+  // curr->operation will be set in a later layer
 
   for (; p != words.end(); ++p) {
     curr->ingredients.push_back(reagent(*p));