about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--020run.cc1
-rw-r--r--030container.cc13
2 files changed, 14 insertions, 0 deletions
diff --git a/020run.cc b/020run.cc
index 9b20a61e..ed364b37 100644
--- a/020run.cc
+++ b/020run.cc
@@ -196,6 +196,7 @@ if (argc > 1) {
   if (Run_tests) Recipe.erase(get(Recipe_ordinal, "main"));
 }
 transform_all();
+//? cerr << to_original_string(get(Type_ordinal, "editor")) << '\n';
 //? cerr << to_original_string(get(Recipe, get(Recipe_ordinal, "event-loop"))) << '\n';
 //? DUMP("");
 //? exit(0);
diff --git a/030container.cc b/030container.cc
index 2e5da42e..507dace3 100644
--- a/030container.cc
+++ b/030container.cc
@@ -900,3 +900,16 @@ void check_invalid_types(const type_tree* type, const string& location_for_error
       raise << location_for_error_messages << "unknown type in " << name_for_error_messages << '\n' << end();
   }
 }
+
+string to_original_string(const type_ordinal t) {
+  ostringstream out;
+  if (!contains_key(Type, t)) return out.str();
+  const type_info& info = get(Type, t);
+  if (info.kind == PRIMITIVE) return out.str();
+  out << (info.kind == CONTAINER ? "container" : "exclusive-container") << " " << info.name << " [\n";
+  for (int i = 0;  i < SIZE(info.elements);  ++i) {
+    out << "  " << info.elements.at(i).original_string << "\n";
+  }
+  out << "]\n";
+  return out.str();
+}