diff options
-rw-r--r-- | 010vm.cc | 24 | ||||
-rw-r--r-- | 030container.cc | 25 |
2 files changed, 24 insertions, 25 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; diff --git a/030container.cc b/030container.cc index 2f678687..629376b4 100644 --- a/030container.cc +++ b/030container.cc @@ -191,31 +191,6 @@ case GET: { break; } -:(code) -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 << ">"; -} - :(scenario get_handles_nested_container_elements) recipe main [ 12:number <- copy 34 |