diff options
-rw-r--r-- | 010vm.cc | 22 | ||||
-rw-r--r-- | 059shape_shifting_recipe.cc | 22 |
2 files changed, 22 insertions, 22 deletions
diff --git a/010vm.cc b/010vm.cc index d10bfa7d..3a916e58 100644 --- a/010vm.cc +++ b/010vm.cc @@ -467,28 +467,6 @@ string debug_string(const reagent& x) { return out.str(); } -string inspect(const string_tree* x) { - ostringstream out; - dump_inspect(x, out); - return out.str(); -} - -void dump_inspect(const string_tree* x, ostream& out) { - if (!x->left && !x->right) { - out << x->value; - return; - } - out << '('; - for (const string_tree* curr = x; curr; curr = curr->right) { - if (curr != x) out << ' '; - if (curr->left) - dump_inspect(curr->left, out); - else - out << curr->value; - } - out << ')'; -} - string to_string(const string_tree* property) { if (!property) return "()"; ostringstream out; diff --git a/059shape_shifting_recipe.cc b/059shape_shifting_recipe.cc index e8c3fcdf..79f4094c 100644 --- a/059shape_shifting_recipe.cc +++ b/059shape_shifting_recipe.cc @@ -430,6 +430,28 @@ void replace_type_ingredients(string_tree* type, const map<string, const string_ replace_type_ingredients(type->right, mappings); } +string inspect(const string_tree* x) { + ostringstream out; + dump_inspect(x, out); + return out.str(); +} + +void dump_inspect(const string_tree* x, ostream& out) { + if (!x->left && !x->right) { + out << x->value; + return; + } + out << '('; + for (const string_tree* curr = x; curr; curr = curr->right) { + if (curr != x) out << ' '; + if (curr->left) + dump_inspect(curr->left, out); + else + out << curr->value; + } + out << ')'; +} + void ensure_all_concrete_types(/*const*/ recipe& new_recipe, const recipe& exemplar) { for (long long int i = 0; i < SIZE(new_recipe.ingredients); ++i) ensure_all_concrete_types(new_recipe.ingredients.at(i), exemplar); |