diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-11-15 01:44:58 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-11-15 01:44:58 -0800 |
commit | 360d45e68edf92e85e3ae7cb198be88182374331 (patch) | |
tree | 05fecfe8484d222d79ee68f6255a6bf7f1fa41a9 /010vm.cc | |
parent | 28ca3dbc71a3c3258bb7876fe1bae7c5edac4438 (diff) | |
download | mu-360d45e68edf92e85e3ae7cb198be88182374331.tar.gz |
2444
Yet another bugfix as I trace through the last session with Caleb.
Diffstat (limited to '010vm.cc')
-rw-r--r-- | 010vm.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/010vm.cc b/010vm.cc index 0b2888f0..312aa3fc 100644 --- a/010vm.cc +++ b/010vm.cc @@ -484,11 +484,18 @@ bool deeply_equal(const string_tree* a, const string_tree* b) { && deeply_equal(a->right, b->right); } +:(before "End Globals") +set<string> Literal_type_names; +:(before "End One-time Setup") +Literal_type_names.insert("literal"); +Literal_type_names.insert("number"); +Literal_type_names.insert("character"); +:(code) bool deeply_equal_types(const string_tree* a, const string_tree* b) { if (!a) return !b; if (!b) return !a; - if (a->value == "character" && b->value == "number") return true; - if (a->value == "number" && b->value == "character") return true; + if (Literal_type_names.find(a->value) != Literal_type_names.end()) + return Literal_type_names.find(b->value) != Literal_type_names.end(); return a->value == b->value && deeply_equal_types(a->left, b->left) && deeply_equal_types(a->right, b->right); |