diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-26 01:01:04 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-26 01:01:04 -0700 |
commit | 9cc389ce771636c1350c269ef042c47c427ecd28 (patch) | |
tree | edf83e1683ffee6b73cb73f3c1c147aaebe98f7c /010vm.cc | |
parent | 4ea0480806d123a0f97bd2b5a867fea603b63e87 (diff) | |
download | mu-9cc389ce771636c1350c269ef042c47c427ecd28.tar.gz |
2281
Diffstat (limited to '010vm.cc')
-rw-r--r-- | 010vm.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/010vm.cc b/010vm.cc index 61e46909..8e3bab59 100644 --- a/010vm.cc +++ b/010vm.cc @@ -303,6 +303,30 @@ string reagent::to_string() const { return out.str(); } +string dump_types(const reagent& x) { + ostringstream out; + dump_types(x.type, out); + return out.str(); +} + +void dump_types(type_tree* type, ostringstream& out) { + if (!type->left && !type->right) { + out << Type[type->value].name; + return; + } + out << "<"; + if (type->left) + dump_types(type->left, out); + else + out << Type[type->value].name; + out << " : "; + if (type->right) + dump_types(type->right, out); + else + out << " : <>"; + out << ">"; +} + string instruction::to_string() const { if (is_label) return label; ostringstream out; |