about summary refs log tree commit diff stats
path: root/010vm.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 /010vm.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 '010vm.cc')
-rw-r--r--010vm.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/010vm.cc b/010vm.cc
index 21dd28d0..bdf4ec17 100644
--- a/010vm.cc
+++ b/010vm.cc
@@ -33,6 +33,7 @@ struct instruction {
   bool is_label;
   string label;  // only if is_label
   string name;  // only if !is_label
+  string old_name;  // before our automatic rewrite rules
   recipe_ordinal operation;  // Recipe_ordinal[name]
   vector<reagent> ingredients;  // only if !is_label
   vector<reagent> products;  // only if !is_label
@@ -227,8 +228,8 @@ recipe::recipe() {
 instruction::instruction() :is_label(false), operation(IDLE) {
   // End instruction Constructor
 }
-void instruction::clear() { is_label=false; label.clear(); operation=IDLE; ingredients.clear(); products.clear(); }
-bool instruction::is_clear() { return !is_label && operation == IDLE; }
+void instruction::clear() { is_label=false; label.clear(); name.clear(); old_name.clear(); operation=IDLE; ingredients.clear(); products.clear(); }
+bool instruction::is_clear() { return !is_label && name.empty(); }
 
 // Reagents have the form <name>:<type>:<type>:.../<property>/<property>/...
 reagent::reagent(string s) :original_string(s), value(0), initialized(false), type(NULL) {