diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-03-17 11:23:29 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-03-17 13:19:20 -0700 |
commit | 3ba6357924e1098a28e43c94a4573a3d2978b5e9 (patch) | |
tree | 9a5a4b181a82a77646b1c9d796bdd8b4159dc337 /cpp/010vm | |
parent | 5f0e4762468c412d57fb54236a0ee90e23a2cb14 (diff) | |
download | mu-3ba6357924e1098a28e43c94a4573a3d2978b5e9.tar.gz |
949 - paving the way for jumps to labels
Addresses for reagents are now computed after all transforms.
Diffstat (limited to 'cpp/010vm')
-rw-r--r-- | cpp/010vm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cpp/010vm b/cpp/010vm index 049630d3..8bb1604b 100644 --- a/cpp/010vm +++ b/cpp/010vm @@ -139,7 +139,7 @@ void setup_recipes() { void instruction::clear() { is_label=false; label.clear(); operation=IDLE; ingredients.clear(); products.clear(); } // Reagents have the form <name>:<type>:<type>:.../<property>/<property>/... - reagent::reagent(string s) { + reagent::reagent(string s) :value(0) { istringstream in(s); // properties while (!in.eof()) { @@ -152,12 +152,11 @@ void setup_recipes() { } // structures for the first row of properties name = properties[0].first; - value = to_int(name); for (size_t i = 0; i < properties[0].second.size(); ++i) { types.push_back(Type_number[properties[0].second[i]]); } } - reagent::reagent(type_number t) { + reagent::reagent(type_number t) :value(0) { types.push_back(t); } string reagent::to_string() { |