From 805d58c6aeeeba3e4989c0eed6781b3861e8fae0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 25 Jan 2018 22:39:31 -0800 Subject: 4199 --- html/046check_type_by_name.cc.html | 75 +++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 38 deletions(-) (limited to 'html/046check_type_by_name.cc.html') diff --git a/html/046check_type_by_name.cc.html b/html/046check_type_by_name.cc.html index e0024aa2..dd7bcee9 100644 --- a/html/046check_type_by_name.cc.html +++ b/html/046check_type_by_name.cc.html @@ -15,19 +15,18 @@ body { font-size: 12pt; font-family: monospace; color: #aaaaaa; background-color a { color:#eeeeee; text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } -.Conceal { color: #4e4e4e; } -.traceContains { color: #008000; } -.Constant { color: #00a0a0; } .LineNr { color: #444444; } .traceAbsent { color: #c00000; } +.Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } +.Delimiter { color: #800080; } +.Special { color: #c00000; } .Identifier { color: #c0a020; } .Normal { color: #aaaaaa; background-color: #080808; padding-bottom: 1px; } .Comment { color: #9090ff; } .Comment a { color:#0000ee; text-decoration:underline; } -.Delimiter { color: #800080; } -.Special { color: #c00000; } .cSpecial { color: #008000; } -.muRecipe { color: #ff8700; } +.traceContains { color: #008000; } --> @@ -87,15 +86,15 @@ if ('onhashchange' in window) { 23 recipe& caller = get(Recipe, r); 24 set<reagent> known; 25 for (int i = 0; i < SIZE(caller.steps); ++i) { - 26 ¦ instruction& inst = caller.steps.at(i); - 27 ¦ for (int in = 0; in < SIZE(inst.ingredients); ++in) { - 28 ¦ ¦ deduce_missing_type(known, inst.ingredients.at(in), caller); - 29 ¦ ¦ check_type(known, inst.ingredients.at(in), caller); - 30 ¦ } - 31 ¦ for (int out = 0; out < SIZE(inst.products); ++out) { - 32 ¦ ¦ deduce_missing_type(known, inst.products.at(out), caller); - 33 ¦ ¦ check_type(known, inst.products.at(out), caller); - 34 ¦ } + 26 instruction& inst = caller.steps.at(i); + 27 for (int in = 0; in < SIZE(inst.ingredients); ++in) { + 28 deduce_missing_type(known, inst.ingredients.at(in), caller); + 29 check_type(known, inst.ingredients.at(in), caller); + 30 } + 31 for (int out = 0; out < SIZE(inst.products); ++out) { + 32 deduce_missing_type(known, inst.products.at(out), caller); + 33 check_type(known, inst.products.at(out), caller); + 34 } 35 } 36 } 37 @@ -103,20 +102,20 @@ if ('onhashchange' in window) { 39 // Deduce Missing Type(x, caller) 40 if (x.type) return; 41 if (is_jump_target(x.name)) { - 42 ¦ x.type = new type_tree("label"); - 43 ¦ return; + 42 x.type = new type_tree("label"); + 43 return; 44 } 45 if (known.find(x) == known.end()) return; 46 const reagent& exemplar = *known.find(x); 47 x.type = new type_tree(*exemplar.type); 48 trace(9992, "transform") << x.name << " <= " << names_to_string(x.type) << end(); 49 // spaces are special; their type includes their /names property - 50 if (is_mu_space(x) && !has_property(x, "names")) { - 51 ¦ if (!has_property(exemplar, "names")) { - 52 ¦ ¦ raise << maybe(caller.name) << "missing /names property for space variable '" << exemplar.name << "'\n" << end(); - 53 ¦ ¦ return; - 54 ¦ } - 55 ¦ x.properties.push_back(pair<string, string_tree*>("names", new string_tree(*property(exemplar, "names")))); + 50 if (is_mu_space(x) && !has_property(x, "names")) { + 51 if (!has_property(exemplar, "names")) { + 52 raise << maybe(caller.name) << "missing /names property for space variable '" << exemplar.name << "'\n" << end(); + 53 return; + 54 } + 55 x.properties.push_back(pair<string, string_tree*>("names", new string_tree(*property(exemplar, "names")))); 56 } 57 } 58 @@ -125,27 +124,27 @@ if ('onhashchange' in window) { 61 if (is_integer(x.name)) return; // if you use raw locations you're probably doing something unsafe 62 if (!x.type) return; // might get filled in by other logic later 63 if (is_jump_target(x.name)) { - 64 ¦ if (!x.type->atom || x.type->name != "label") - 65 ¦ ¦ raise << maybe(caller.name) << "non-label '" << x.name << "' must begin with a letter\n" << end(); - 66 ¦ return; + 64 if (!x.type->atom || x.type->name != "label") + 65 raise << maybe(caller.name) << "non-label '" << x.name << "' must begin with a letter\n" << end(); + 66 return; 67 } 68 if (known.find(x) == known.end()) { - 69 ¦ trace(9992, "transform") << x.name << " => " << names_to_string(x.type) << end(); - 70 ¦ known.insert(x); + 69 trace(9992, "transform") << x.name << " => " << names_to_string(x.type) << end(); + 70 known.insert(x); 71 } 72 if (!types_strictly_match(known.find(x)->type, x.type)) { - 73 ¦ raise << maybe(caller.name) << "'" << x.name << "' used with multiple types\n" << end(); - 74 ¦ return; + 73 raise << maybe(caller.name) << "'" << x.name << "' used with multiple types\n" << end(); + 74 return; 75 } 76 if (is_mu_array(x)) { - 77 ¦ if (!x.type->right) { - 78 ¦ ¦ raise << maybe(caller.name) << "'" << x.name << ": can't be just an array. What is it an array of?\n" << end(); - 79 ¦ ¦ return; - 80 ¦ } - 81 ¦ if (!x.type->right->right) { - 82 ¦ ¦ raise << caller.name << " can't determine the size of array variable '" << x.name << "'. Either allocate it separately and make the type of '" << x.name << "' an address, or specify the length of the array in the type of '" << x.name << "'.\n" << end(); - 83 ¦ ¦ return; - 84 ¦ } + 77 if (!x.type->right) { + 78 raise << maybe(caller.name) << "'" << x.name << ": can't be just an array. What is it an array of?\n" << end(); + 79 return; + 80 } + 81 if (!x.type->right->right) { + 82 raise << caller.name << " can't determine the size of array variable '" << x.name << "'. Either allocate it separately and make the type of '" << x.name << "' an address, or specify the length of the array in the type of '" << x.name << "'.\n" << end(); + 83 return; + 84 } 85 } 86 } 87 -- cgit 1.4.1-2-gfad0