about summary refs log tree commit diff stats
path: root/010vm.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-08 00:10:56 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-08 00:10:56 -0800
commitfa8eda45947ca4d4e394441203c0e871251ec121 (patch)
tree162a570658911c5657fa8a2d2636ba7ee79c4da0 /010vm.cc
parent45f75796d6fa56afe269748bac12519508886376 (diff)
downloadmu-fa8eda45947ca4d4e394441203c0e871251ec121.tar.gz
2396 - edit working again!!
Still some spurious warnings.

This was an insane experience building out generics. Time to reflect.
Where did I go wrong? How did I end up writing no tests? Let's take some
time and go over the last 50 commits with a fine-tooth comb.

Generics seems to be the feature that has moved mu from a VM project to
a compiler project.
Diffstat (limited to '010vm.cc')
-rw-r--r--010vm.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/010vm.cc b/010vm.cc
index a4c5eb54..08858594 100644
--- a/010vm.cc
+++ b/010vm.cc
@@ -464,6 +464,14 @@ string_tree* property(const reagent& r, const string& name) {
   return NULL;
 }
 
+bool deeply_equal(const string_tree* a, const string_tree* b) {
+  if (!a) return !b;
+  if (!b) return !a;
+  return a->value == b->value
+      && deeply_equal(a->left, b->left)
+      && deeply_equal(a->right, b->right);
+}
+
 void dump_memory() {
   for (map<long long int, double>::iterator p = Memory.begin(); p != Memory.end(); ++p) {
     cout << p->first << ": " << no_scientific(p->second) << '\n';