about summary refs log tree commit diff stats
path: root/045closure_name.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-02-19 13:42:45 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-02-19 13:42:45 -0800
commit9f95c7451b940b6644cb6fd6783ea9c17168357e (patch)
treed1443c9c4dc48bdc6bd67c7e16b43b9185d6d835 /045closure_name.cc
parentb83b2cfd6676e0caa18b39f22f01bdebf41c9d58 (diff)
downloadmu-9f95c7451b940b6644cb6fd6783ea9c17168357e.tar.gz
2685
Stack of plans for cleaning up replace_type_ingredients() and a couple
of other things, from main problem to subproblems:

  include type names in the type_tree rather than in the separate properties vector
  make type_tree and string_tree real cons cells, with separate leaf nodes
  redo the vocabulary for dumping various objects:
    do we really need to_string and debug_string?
    can we have a version with *all* information?
    can we have to_string not call debug_string?

This commit nibbles at the edges of the final task, switching from
member method syntax to global function like almost everything else. I'm
mostly using methods just for STL in this project.
Diffstat (limited to '045closure_name.cc')
-rw-r--r--045closure_name.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/045closure_name.cc b/045closure_name.cc
index d16175b1..52e415fc 100644
--- a/045closure_name.cc
+++ b/045closure_name.cc
@@ -58,7 +58,7 @@ void collect_surrounding_spaces(const recipe_ordinal r) {
           || !type->right->right->right
           || type->right->right->right->value != get(Type_ordinal, "location")
           || type->right->right->right->right) {
-        raise_error << "slot 0 should always have type address:shared:array:location, but is " << inst.products.at(j).to_string() << '\n' << end();
+        raise_error << "slot 0 should always have type address:shared:array:location, but is " << to_string(inst.products.at(j)) << '\n' << end();
         continue;
       }
       string_tree* s = property(inst.products.at(j), "names");
@@ -66,7 +66,7 @@ void collect_surrounding_spaces(const recipe_ordinal r) {
         raise_error << "slot 0 requires a /names property in recipe " << get(Recipe, r).name << end();
         continue;
       }
-      if (s->right) raise_error << "slot 0 should have a single value in /names, but got " << inst.products.at(j).to_string() << '\n' << end();
+      if (s->right) raise_error << "slot 0 should have a single value in /names, but got " << to_string(inst.products.at(j)) << '\n' << end();
       const string& surrounding_recipe_name = s->value;
       if (surrounding_recipe_name.empty()) {
         raise_error << "slot 0 doesn't initialize its /names property in recipe " << get(Recipe, r).name << end();
@@ -112,7 +112,7 @@ long long int lookup_name(const reagent& x, const recipe_ordinal default_recipe)
 long long int lookup_name(const reagent& x, const recipe_ordinal r, set<recipe_ordinal>& done, vector<recipe_ordinal>& path) {
   if (!Name[r].empty()) return Name[r][x.name];
   if (contains_key(done, r)) {
-    raise_error << "can't compute address of " << x.to_string() << " because " << end();
+    raise_error << "can't compute address of " << to_string(x) << " because " << end();
     for (long long int i = 1; i < SIZE(path); ++i) {
       raise_error << path.at(i-1) << " requires computing names of " << path.at(i) << '\n' << end();
     }