diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-11-18 13:50:37 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-11-18 13:50:37 -0800 |
commit | 59b6a42aac60a8be4b637a6a1cffa2bf371e7302 (patch) | |
tree | 8acd6bd9a4f5b3822f59c573197dcf7bd4955c57 | |
parent | 322ce34d77b4e2d8c6d721b156c02496d105741f (diff) | |
download | mu-59b6a42aac60a8be4b637a6a1cffa2bf371e7302.tar.gz |
2459
-rw-r--r-- | 032array.cc | 12 | ||||
-rw-r--r-- | 043new.cc | 10 |
2 files changed, 12 insertions, 10 deletions
diff --git a/032array.cc b/032array.cc index 2bdafbbf..ac883490 100644 --- a/032array.cc +++ b/032array.cc @@ -423,3 +423,15 @@ case LENGTH: { recipe_ordinal r = current_instruction().operation; if (r == CREATE_ARRAY || r == INDEX || r == INDEX_ADDRESS || r == LENGTH) return false; + +//: a particularly common array type is the string, or address:array:character +:(code) +bool is_mu_string(const reagent& x) { + return x.type + && x.type->value == get(Type_ordinal, "address") + && x.type->right + && x.type->right->value == get(Type_ordinal, "array") + && x.type->right->right + && x.type->right->right->value == get(Type_ordinal, "character") + && x.type->right->right->right == NULL; +} diff --git a/043new.cc b/043new.cc index dd0fac14..c3f48bce 100644 --- a/043new.cc +++ b/043new.cc @@ -424,16 +424,6 @@ long long int unicode_length(const string& s) { return result; } -bool is_mu_string(const reagent& x) { - return x.type - && x.type->value == get(Type_ordinal, "address") - && x.type->right - && x.type->right->value == get(Type_ordinal, "array") - && x.type->right->right - && x.type->right->right->value == get(Type_ordinal, "character") - && x.type->right->right->right == NULL; -} - string read_mu_string(long long int address) { long long int size = get_or_insert(Memory, address); if (size == 0) return ""; |