about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-02-20 20:44:59 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-02-20 20:44:59 -0800
commit791c5eb1398bff36c74b1f7581ddff70d298cbc5 (patch)
treea782dba0829ef439ee3691cfd54100972c77d623
parent65c905fe84c0e8b7acd6839469d7bb9727f0632b (diff)
downloadmu-791c5eb1398bff36c74b1f7581ddff70d298cbc5.tar.gz
2679
-rw-r--r--010vm.cc22
-rw-r--r--059shape_shifting_recipe.cc22
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);