diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-26 20:00:38 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-26 20:02:18 -0700 |
commit | ae256ea13efc77cc767a658c6f61b12cd7461e21 (patch) | |
tree | 18dbcb26423b1d17d0639995c4bd29ec8f3d5c17 /032array.cc | |
parent | 7bba6e7bb7fd7bfdfc71626a34a08cb96a084b74 (diff) | |
download | mu-ae256ea13efc77cc767a658c6f61b12cd7461e21.tar.gz |
2283 - represent each /property as a tree
Diffstat (limited to '032array.cc')
-rw-r--r-- | 032array.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/032array.cc b/032array.cc index 9a8a0115..b544df38 100644 --- a/032array.cc +++ b/032array.cc @@ -34,12 +34,12 @@ case CREATE_ARRAY: { break; } // 'create-array' will need to check properties rather than types - if (SIZE(product.properties.at(0).second) <= 2) { + if (!product.properties.at(0).second || !product.properties.at(0).second->right || !product.properties.at(0).second->right->right) { raise_error << maybe(Recipe[r].name) << "create array of what size? " << inst.to_string() << '\n' << end(); break; } - if (!is_integer(product.properties.at(0).second.at(2))) { - raise_error << maybe(Recipe[r].name) << "'create-array' product should specify size of array after its element type, but got " << product.properties.at(0).second.at(2) << '\n' << end(); + if (!is_integer(product.properties.at(0).second->right->right->value)) { + raise_error << maybe(Recipe[r].name) << "'create-array' product should specify size of array after its element type, but got " << product.properties.at(0).second->right->right->value << '\n' << end(); break; } break; @@ -49,7 +49,7 @@ case CREATE_ARRAY: { reagent product = current_instruction().products.at(0); canonize(product); long long int base_address = product.value; - long long int array_size= to_integer(product.properties.at(0).second.at(2)); + long long int array_size = to_integer(product.properties.at(0).second->right->right->value); // initialize array size, so that size_of will work Memory[base_address] = array_size; // in array elements long long int size = size_of(product); // in locations |