From 9f95c7451b940b6644cb6fd6783ea9c17168357e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 19 Feb 2016 13:42:45 -0800 Subject: 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. --- 045closure_name.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '045closure_name.cc') 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& done, vector& 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(); } -- cgit 1.4.1-2-gfad0