diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-05-20 22:09:06 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-05-20 22:11:34 -0700 |
commit | 9dcbec398c5aedf27757365cc1f4c7c36e138539 (patch) | |
tree | 24afbc29a00db1db5b65eb3c390e8d13df7be3ba /045closure_name.cc | |
parent | 5203ba0c5e806ac8e118362d5e2db952a5433e34 (diff) | |
download | mu-9dcbec398c5aedf27757365cc1f4c7c36e138539.tar.gz |
2990
Standardize quotes around reagents in error messages. I'm still sure there's issues. For example, the messages when type-checking 'copy'. I'm not putting quotes around them because in layer 60 I end up creating dilated reagents, and then it's a bit much to have quotes and (two kinds of) brackets. But I'm sure I'm doing that somewhere..
Diffstat (limited to '045closure_name.cc')
-rw-r--r-- | 045closure_name.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/045closure_name.cc b/045closure_name.cc index 1c365f2e..3b62ba58 100644 --- a/045closure_name.cc +++ b/045closure_name.cc @@ -56,28 +56,28 @@ void collect_surrounding_spaces(const recipe_ordinal r) { || !type->right->right || type->right->right->value != get(Type_ordinal, "location") || type->right->right->right) { - raise << "slot 0 should always have type address:array:location, but is " << to_string(inst.products.at(j)) << '\n' << end(); + raise << "slot 0 should always have type address:array:location, but is '" << to_string(inst.products.at(j)) << "'\n" << end(); continue; } string_tree* s = property(inst.products.at(j), "names"); if (!s) { - raise << "slot 0 requires a /names property in recipe " << get(Recipe, r).name << end(); + raise << "slot 0 requires a /names property in recipe '" << get(Recipe, r).name << "'\n" << end(); continue; } - if (s->right) raise << "slot 0 should have a single value in /names, but got " << to_string(inst.products.at(j)) << '\n' << end(); + if (s->right) raise << "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 << "slot 0 doesn't initialize its /names property in recipe " << get(Recipe, r).name << end(); + raise << "slot 0 doesn't initialize its /names property in recipe '" << get(Recipe, r).name << "'\n" << end(); continue; } if (contains_key(Surrounding_space, r) && get(Surrounding_space, r) != get(Recipe_ordinal, surrounding_recipe_name)) { - raise << "recipe " << get(Recipe, r).name << " can have only one 'surrounding' recipe but has " << get(Recipe, get(Surrounding_space, r)).name << " and " << surrounding_recipe_name << '\n' << end(); + raise << "recipe '" << get(Recipe, r).name << "' can have only one 'surrounding' recipe but has '" << get(Recipe, get(Surrounding_space, r)).name << "' and '" << surrounding_recipe_name << "'\n" << end(); continue; } trace(9993, "name") << "lexically surrounding space for recipe " << get(Recipe, r).name << " comes from " << surrounding_recipe_name << end(); if (!contains_key(Recipe_ordinal, surrounding_recipe_name)) { - raise << "can't find recipe providing surrounding space for " << get(Recipe, r).name << ": " << surrounding_recipe_name << '\n' << end(); + raise << "can't find recipe providing surrounding space for '" << get(Recipe, r).name << "'; looking for '" << surrounding_recipe_name << "'\n" << end(); continue; } put(Surrounding_space, r, get(Recipe_ordinal, surrounding_recipe_name)); @@ -110,7 +110,7 @@ int lookup_name(const reagent& x, const recipe_ordinal default_recipe) { 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 << "can't compute address of " << to_string(x) << " because " << end(); + raise << "can't compute address of '" << to_string(x) << "' because\n" << end(); for (int i = 1; i < SIZE(path); ++i) { raise << path.at(i-1) << " requires computing names of " << path.at(i) << '\n' << end(); } @@ -127,7 +127,7 @@ int lookup_name(const reagent& x, const recipe_ordinal r, set<recipe_ordinal>& d recipe_ordinal lookup_surrounding_recipe(const recipe_ordinal r, int n) { if (n == 0) return r; if (!contains_key(Surrounding_space, r)) { - raise << "don't know surrounding recipe of " << get(Recipe, r).name << '\n' << end(); + raise << "don't know surrounding recipe of '" << get(Recipe, r).name << "'\n" << end(); return -1; } assert(contains_key(Surrounding_space, r)); @@ -140,7 +140,7 @@ bool already_transformed(const reagent& r, const map<string, int>& names) { if (has_property(r, "space")) { string_tree* p = property(r, "space"); if (!p || p->right) { - raise << "/space property should have exactly one (non-negative integer) value in " << r.original_string << '\n' << end(); + raise << "/space property should have exactly one (non-negative integer) value in '" << r.original_string << "'\n" << end(); return false; } if (p->value != "0") return true; @@ -154,8 +154,8 @@ def f [ local-scope x:number/space:1 <- copy 34 ] -+error: don't know surrounding recipe of f -+error: f: can't find a place to store x ++error: don't know surrounding recipe of 'f' ++error: f: can't find a place to store 'x' //: extra test for try_reclaim_locals() from previous layers :(scenario local_scope_ignores_nonlocal_spaces) |