diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-29 17:15:09 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-29 17:15:09 -0700 |
commit | e6692482643dc007988188e2b19fbb9219ca2833 (patch) | |
tree | cbb805cba3bd46dfc7d71adaa2150d9acb5cc5ba /011load.cc | |
parent | 5a702544a6f8aa3fa520ba387a6c0e803e076476 (diff) | |
download | mu-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.cc | 11 |
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)); |