From 9e751bb8c0cdf771d34c839cb6591d892b8e62de Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 7 Mar 2017 01:41:48 -0800 Subject: 3761 --- html/045closure_name.cc.html | 103 ++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 51 deletions(-) (limited to 'html/045closure_name.cc.html') diff --git a/html/045closure_name.cc.html b/html/045closure_name.cc.html index b54d3153..b400cdd3 100644 --- a/html/045closure_name.cc.html +++ b/html/045closure_name.cc.html @@ -15,16 +15,17 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color a { text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } -.Constant { color: #00a0a0; } .Special { color: #c00000; } .muRecipe { color: #ff8700; } -.traceContains { color: #008000; } +.Conceal { color: #4e4e4e; } +.cSpecial { color: #008000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .LineNr { color: #444444; } .Identifier { color: #c0a020; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.cSpecial { color: #008000; } +.Constant { color: #00a0a0; } +.traceContains { color: #008000; } --> @@ -100,38 +101,38 @@ if ('onhashchange' in window) { 39 void collect_surrounding_spaces(const recipe_ordinal r) { 40 trace(9991, "transform") << "--- collect surrounding spaces for recipe " << get(Recipe, r).name << end(); 41 for (int i = 0; i < SIZE(get(Recipe, r).steps); ++i) { - 42 const instruction& inst = get(Recipe, r).steps.at(i); - 43 if (inst.is_label) continue; - 44 for (int j = 0; j < SIZE(inst.products); ++j) { - 45 if (is_literal(inst.products.at(j))) continue; - 46 if (inst.products.at(j).name != "0") continue; - 47 if (!is_space(inst.products.at(j))) { - 48 raise << "slot 0 should always have type address:array:location, but is '" << to_string(inst.products.at(j)) << "'\n" << end(); - 49 continue; - 50 } - 51 string_tree* s = property(inst.products.at(j), "names"); - 52 if (!s) { - 53 raise << "slot 0 requires a /names property in recipe '" << get(Recipe, r).name << "'\n" << end(); - 54 continue; - 55 } - 56 if (!s->atom) raise << "slot 0 should have a single value in /names, but got '" << to_string(inst.products.at(j)) << "'\n" << end(); - 57 const string& surrounding_recipe_name = s->value; - 58 if (surrounding_recipe_name.empty()) { - 59 raise << "slot 0 doesn't initialize its /names property in recipe '" << get(Recipe, r).name << "'\n" << end(); - 60 continue; - 61 } - 62 if (contains_key(Surrounding_space, r) - 63 && get(Surrounding_space, r) != get(Recipe_ordinal, surrounding_recipe_name)) { - 64 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(); - 65 continue; - 66 } - 67 trace(9993, "name") << "lexically surrounding space for recipe " << get(Recipe, r).name << " comes from " << surrounding_recipe_name << end(); - 68 if (!contains_key(Recipe_ordinal, surrounding_recipe_name)) { - 69 raise << "can't find recipe providing surrounding space for '" << get(Recipe, r).name << "'; looking for '" << surrounding_recipe_name << "'\n" << end(); - 70 continue; - 71 } - 72 put(Surrounding_space, r, get(Recipe_ordinal, surrounding_recipe_name)); - 73 } + 42 ¦ const instruction& inst = get(Recipe, r).steps.at(i); + 43 ¦ if (inst.is_label) continue; + 44 ¦ for (int j = 0; j < SIZE(inst.products); ++j) { + 45 ¦ ¦ if (is_literal(inst.products.at(j))) continue; + 46 ¦ ¦ if (inst.products.at(j).name != "0") continue; + 47 ¦ ¦ if (!is_space(inst.products.at(j))) { + 48 ¦ ¦ ¦ raise << "slot 0 should always have type address:array:location, but is '" << to_string(inst.products.at(j)) << "'\n" << end(); + 49 ¦ ¦ ¦ continue; + 50 ¦ ¦ } + 51 ¦ ¦ string_tree* s = property(inst.products.at(j), "names"); + 52 ¦ ¦ if (!s) { + 53 ¦ ¦ ¦ raise << "slot 0 requires a /names property in recipe '" << get(Recipe, r).name << "'\n" << end(); + 54 ¦ ¦ ¦ continue; + 55 ¦ ¦ } + 56 ¦ ¦ if (!s->atom) raise << "slot 0 should have a single value in /names, but got '" << to_string(inst.products.at(j)) << "'\n" << end(); + 57 ¦ ¦ const string& surrounding_recipe_name = s->value; + 58 ¦ ¦ if (surrounding_recipe_name.empty()) { + 59 ¦ ¦ ¦ raise << "slot 0 doesn't initialize its /names property in recipe '" << get(Recipe, r).name << "'\n" << end(); + 60 ¦ ¦ ¦ continue; + 61 ¦ ¦ } + 62 ¦ ¦ if (contains_key(Surrounding_space, r) + 63 ¦ ¦ ¦ ¦ && get(Surrounding_space, r) != get(Recipe_ordinal, surrounding_recipe_name)) { + 64 ¦ ¦ ¦ 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(); + 65 ¦ ¦ ¦ continue; + 66 ¦ ¦ } + 67 ¦ ¦ trace(9993, "name") << "lexically surrounding space for recipe " << get(Recipe, r).name << " comes from " << surrounding_recipe_name << end(); + 68 ¦ ¦ if (!contains_key(Recipe_ordinal, surrounding_recipe_name)) { + 69 ¦ ¦ ¦ raise << "can't find recipe providing surrounding space for '" << get(Recipe, r).name << "'; looking for '" << surrounding_recipe_name << "'\n" << end(); + 70 ¦ ¦ ¦ continue; + 71 ¦ ¦ } + 72 ¦ ¦ put(Surrounding_space, r, get(Recipe_ordinal, surrounding_recipe_name)); + 73 ¦ } 74 } 75 } 76 @@ -141,8 +142,8 @@ if ('onhashchange' in window) { 80 :(replace{} "int lookup_name(const reagent& r, const recipe_ordinal default_recipe)") 81 int lookup_name(const reagent& x, const recipe_ordinal default_recipe) { 82 if (!has_property(x, "space")) { - 83 if (Name[default_recipe].empty()) raise << "name not found: " << x.name << '\n' << end(); - 84 return Name[default_recipe][x.name]; + 83 ¦ if (Name[default_recipe].empty()) raise << "name not found: " << x.name << '\n' << end(); + 84 ¦ return Name[default_recipe][x.name]; 85 } 86 string_tree* p = property(x, "space"); 87 if (!p || !p->atom) raise << "/space property should have exactly one (non-negative integer) value\n" << end(); @@ -160,12 +161,12 @@ if ('onhashchange' in window) { 99 int lookup_name(const reagent& x, const recipe_ordinal r, set<recipe_ordinal>& done, vector<recipe_ordinal>& path) { 100 if (!Name[r].empty()) return Name[r][x.name]; 101 if (contains_key(done, r)) { -102 raise << "can't compute address of '" << to_string(x) << "' because\n" << end(); -103 for (int i = 1; i < SIZE(path); ++i) { -104 raise << path.at(i-1) << " requires computing names of " << path.at(i) << '\n' << end(); -105 } -106 raise << path.at(SIZE(path)-1) << " requires computing names of " << r << "..ad infinitum\n" << end(); -107 return -1; +102 ¦ raise << "can't compute address of '" << to_string(x) << "' because\n" << end(); +103 ¦ for (int i = 1; i < SIZE(path); ++i) { +104 ¦ ¦ raise << path.at(i-1) << " requires computing names of " << path.at(i) << '\n' << end(); +105 ¦ } +106 ¦ raise << path.at(SIZE(path)-1) << " requires computing names of " << r << "..ad infinitum\n" << end(); +107 ¦ return -1; 108 } 109 done.insert(r); 110 path.push_back(r); @@ -177,8 +178,8 @@ if ('onhashchange' in window) { 116 recipe_ordinal lookup_surrounding_recipe(const recipe_ordinal r, int n) { 117 if (n == 0) return r; 118 if (!contains_key(Surrounding_space, r)) { -119 raise << "don't know surrounding recipe of '" << get(Recipe, r).name << "'\n" << end(); -120 return -1; +119 ¦ raise << "don't know surrounding recipe of '" << get(Recipe, r).name << "'\n" << end(); +120 ¦ return -1; 121 } 122 assert(contains_key(Surrounding_space, r)); 123 return lookup_surrounding_recipe(get(Surrounding_space, r), n-1); @@ -188,12 +189,12 @@ if ('onhashchange' in window) { 127 :(replace{} "bool already_transformed(const reagent& r, const map<string, int>& names)") 128 bool already_transformed(const reagent& r, const map<string, int>& names) { 129 if (has_property(r, "space")) { -130 string_tree* p = property(r, "space"); -131 if (!p || !p->atom) { -132 raise << "/space property should have exactly one (non-negative integer) value in '" << r.original_string << "'\n" << end(); -133 return false; -134 } -135 if (p->value != "0") return true; +130 ¦ string_tree* p = property(r, "space"); +131 ¦ if (!p || !p->atom) { +132 ¦ ¦ raise << "/space property should have exactly one (non-negative integer) value in '" << r.original_string << "'\n" << end(); +133 ¦ ¦ return false; +134 ¦ } +135 ¦ if (p->value != "0") return true; 136 } 137 return contains_key(names, r.name); 138 } -- cgit 1.4.1-2-gfad0