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/069hash.cc.html | 75 ++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) (limited to 'html/069hash.cc.html') diff --git a/html/069hash.cc.html b/html/069hash.cc.html index 1c454bb6..38bfc900 100644 --- a/html/069hash.cc.html +++ b/html/069hash.cc.html @@ -15,18 +15,19 @@ 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; } -.cSpecial { color: #008000; } +.CommentedCode { color: #6c6c6c; } .muRecipe { color: #ff8700; } +.muData { color: #ffff00; } .Special { color: #c00000; } -.Comment { color: #9090ff; } +.cSpecial { color: #008000; } .Delimiter { color: #800080; } -.LineNr { color: #444444; } -.Identifier { color: #c0a020; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } -.muData { color: #ffff00; } -.CommentedCode { color: #6c6c6c; } .traceContains { color: #008000; } +.Conceal { color: #4e4e4e; } +.Comment { color: #9090ff; } +.Constant { color: #00a0a0; } +.LineNr { color: #444444; } +.Identifier { color: #c0a020; } --> @@ -78,8 +79,8 @@ if ('onhashchange' in window) { 15 :(before "End Primitive Recipe Checks") 16 case HASH: { 17 if (SIZE(inst.ingredients) != 1) { - 18 raise << maybe(get(Recipe, r).name) << "'hash' takes exactly one ingredient rather than '" << inst.original_string << "'\n" << end(); - 19 break; + 18 ¦ raise << maybe(get(Recipe, r).name) << "'hash' takes exactly one ingredient rather than '" << inst.original_string << "'\n" << end(); + 19 ¦ break; 20 } 21 break; 22 } @@ -97,17 +98,17 @@ if ('onhashchange' in window) { 34 size_t hash(size_t h, reagent/*copy*/ r) { 35 canonize(r); 36 if (is_mu_text(r)) // optimization - 37 return hash_mu_text(h, r); + 37 ¦ return hash_mu_text(h, r); 38 else if (is_mu_address(r)) - 39 return hash_mu_address(h, r); + 39 ¦ return hash_mu_address(h, r); 40 else if (is_mu_scalar(r)) - 41 return hash_mu_scalar(h, r); + 41 ¦ return hash_mu_scalar(h, r); 42 else if (is_mu_array(r)) - 43 return hash_mu_array(h, r); + 43 ¦ return hash_mu_array(h, r); 44 else if (is_mu_container(r)) - 45 return hash_mu_container(h, r); + 45 ¦ return hash_mu_container(h, r); 46 else if (is_mu_exclusive_container(r)) - 47 return hash_mu_exclusive_container(h, r); + 47 ¦ return hash_mu_exclusive_container(h, r); 48 assert(false); 49 } 50 @@ -121,8 +122,8 @@ if ('onhashchange' in window) { 58 trace(9999, "mem") << "location " << r.value << " is " << no_scientific(get_or_insert(Memory, r.value)) << end(); 59 r.set_value(get_or_insert(Memory, r.value)); 60 if (r.value != 0) { - 61 trace(9999, "mem") << "skipping refcount at " << r.value << end(); - 62 r.set_value(r.value+1); // skip refcount + 61 ¦ trace(9999, "mem") << "skipping refcount at " << r.value << end(); + 62 ¦ r.set_value(r.value+1); // skip refcount 63 } 64 drop_from_type(r, "address"); 65 return hash(h, r); @@ -131,7 +132,7 @@ if ('onhashchange' in window) { 68 size_t hash_mu_text(size_t h, const reagent& r) { 69 string input = read_mu_text(get_or_insert(Memory, r.value)); 70 for (int i = 0; i < SIZE(input); ++i) { - 71 h = hash_iter(h, static_cast<size_t>(input.at(i))); + 71 ¦ h = hash_iter(h, static_cast<size_t>(input.at(i))); 72 //? cerr << i << ": " << h << '\n'; 73 } 74 return h; @@ -143,9 +144,9 @@ if ('onhashchange' in window) { 80 delete elem.type; 81 elem.type = copy_array_element(r.type); 82 for (int i=0, address = r.value+1; i < size; ++i, address += size_of(elem)) { - 83 reagent/*copy*/ tmp = elem; - 84 tmp.set_value(address); - 85 h = hash(h, tmp); + 83 ¦ reagent/*copy*/ tmp = elem; + 84 ¦ tmp.set_value(address); + 85 ¦ h = hash(h, tmp); 86 //? cerr << i << " (" << address << "): " << h << '\n'; 87 } 88 return h; @@ -156,12 +157,12 @@ if ('onhashchange' in window) { 93 int address = r.value; 94 int offset = 0; 95 for (int i = 0; i < SIZE(info.elements); ++i) { - 96 reagent/*copy*/ element = element_type(r.type, i); - 97 if (has_property(element, "ignore-for-hash")) continue; - 98 element.set_value(address+offset); - 99 h = hash(h, element); + 96 ¦ reagent/*copy*/ element = element_type(r.type, i); + 97 ¦ if (has_property(element, "ignore-for-hash")) continue; + 98 ¦ element.set_value(address+offset); + 99 ¦ h = hash(h, element); 100 //? cerr << i << ": " << h << '\n'; -101 offset += size_of(info.elements.at(i).type); +101 ¦ offset += size_of(info.elements.at(i).type); 102 } 103 return h; 104 } @@ -173,7 +174,7 @@ if ('onhashchange' in window) { 110 reagent/*copy*/ variant = variant_type(r, tag); 111 // todo: move this error to container definition time 112 if (has_property(variant, "ignore-for-hash")) -113 raise << get(Type, type->value).name << ": /ignore-for-hash won't work in exclusive containers\n" << end(); +113 ¦ raise << get(Type, type->value).name << ": /ignore-for-hash won't work in exclusive containers\n" << end(); 114 variant.set_value(r.value + /*skip tag*/1); 115 h = hash(h, variant); 116 return h; @@ -414,12 +415,12 @@ if ('onhashchange' in window) { 351 :(before "End Primitive Recipe Checks") 352 case HASH_OLD: { 353 if (SIZE(inst.ingredients) != 1) { -354 raise << maybe(get(Recipe, r).name) << "'hash_old' takes exactly one ingredient rather than '" << inst.original_string << "'\n" << end(); -355 break; +354 ¦ raise << maybe(get(Recipe, r).name) << "'hash_old' takes exactly one ingredient rather than '" << inst.original_string << "'\n" << end(); +355 ¦ break; 356 } 357 if (!is_mu_text(inst.ingredients.at(0))) { -358 raise << maybe(get(Recipe, r).name) << "'hash_old' currently only supports texts (address array character), but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); -359 break; +358 ¦ raise << maybe(get(Recipe, r).name) << "'hash_old' currently only supports texts (address array character), but got '" << inst.ingredients.at(0).original_string << "'\n" << end(); +359 ¦ break; 360 } 361 break; 362 } @@ -429,13 +430,13 @@ if ('onhashchange' in window) { 366 size_t h = 0 ; 367 368 for (int i = 0; i < SIZE(input); ++i) { -369 h += static_cast<size_t>(input.at(i)); -370 h += (h<<10); -371 h ^= (h>>6); +369 ¦ h += static_cast<size_t>(input.at(i)); +370 ¦ h += (h<<10); +371 ¦ h ^= (h>>6); 372 -373 h += (h<<3); -374 h ^= (h>>11); -375 h += (h<<15); +373 ¦ h += (h<<3); +374 ¦ h ^= (h>>11); +375 ¦ h += (h<<15); 376 } 377 378 products.resize(1); -- cgit 1.4.1-2-gfad0