From 2c678a4e1d7f97c862342ee19cf2d6ee6e901d85 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 29 May 2017 14:21:32 -0700 Subject: 3897 - various updates to documentation --- html/033exclusive_container.cc.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'html/033exclusive_container.cc.html') diff --git a/html/033exclusive_container.cc.html b/html/033exclusive_container.cc.html index 10cfd6ce..31803282 100644 --- a/html/033exclusive_container.cc.html +++ b/html/033exclusive_container.cc.html @@ -72,8 +72,8 @@ if ('onhashchange' in window) { 7 :(before "End Mu Types Initialization") 8 //: We'll use this container as a running example, with two number elements. 9 { - 10 type_ordinal tmp = put(Type_ordinal, "number-or-point", Next_type_ordinal++); - 11 get_or_insert(Type, tmp); // initialize + 10 type_ordinal tmp = put(Type_ordinal, "number-or-point", Next_type_ordinal++); + 11 get_or_insert(Type, tmp); // initialize 12 get(Type, tmp).kind = EXCLUSIVE_CONTAINER; 13 get(Type, tmp).name = "number-or-point"; 14 get(Type, tmp).elements.push_back(reagent("i:number")); @@ -111,7 +111,7 @@ if ('onhashchange' in window) { 46 // (So, like containers, it can only contain arrays if they're static and 47 // include their length in the type.) 48 container_metadata metadata; - 49 for (int i = 0; i < SIZE(exclusive_container_info.elements); ++i) { + 49 for (int i = 0; i < SIZE(exclusive_container_info.elements); ++i) { 50 ¦ reagent/*copy*/ element = exclusive_container_info.elements.at(i); 51 ¦ // Compute Exclusive Container Size(element, full_type) 52 ¦ compute_container_sizes(element.type, pending_metadata, location_for_error_messages); @@ -131,7 +131,7 @@ if ('onhashchange' in window) { 66 //: 'maybe-convert' requires a literal in ingredient 1. We'll use a synonym 67 //: called 'variant'. 68 :(before "End Mu Types Initialization") - 69 put(Type_ordinal, "variant", 0); + 69 put(Type_ordinal, "variant", 0); 70 71 :(scenario maybe_convert) 72 def main [ @@ -160,11 +160,11 @@ if ('onhashchange' in window) { 95 :(before "End Primitive Recipe Declarations") 96 MAYBE_CONVERT, 97 :(before "End Primitive Recipe Numbers") - 98 put(Recipe_ordinal, "maybe-convert", MAYBE_CONVERT); + 98 put(Recipe_ordinal, "maybe-convert", MAYBE_CONVERT); 99 :(before "End Primitive Recipe Checks") 100 case MAYBE_CONVERT: { 101 const recipe& caller = get(Recipe, r); -102 if (SIZE(inst.ingredients) != 2) { +102 if (SIZE(inst.ingredients) != 2) { 103 ¦ raise << maybe(caller.name) << "'maybe-convert' expects exactly 2 ingredients in '" << to_original_string(inst) << "'\n" << end(); 104 ¦ break; 105 } @@ -185,7 +185,7 @@ if ('onhashchange' in window) { 120 ¦ break; 121 } 122 if (inst.products.empty()) break; -123 if (SIZE(inst.products) != 2) { +123 if (SIZE(inst.products) != 2) { 124 ¦ raise << maybe(caller.name) << "'maybe-convert' expects exactly 2 products in '" << to_original_string(inst) << "'\n" << end(); 125 ¦ break; 126 } @@ -193,7 +193,7 @@ if ('onhashchange' in window) { 128 // Update MAYBE_CONVERT product in Check 129 reagent& offset = inst.ingredients.at(1); 130 populate_value(offset); -131 if (offset.value >= SIZE(get(Type, base_type->value).elements)) { +131 if (offset.value >= SIZE(get(Type, base_type->value).elements)) { 132 ¦ raise << maybe(caller.name) << "invalid tag " << offset.value << " in '" << to_original_string(inst) << '\n' << end(); 133 ¦ break; 134 } @@ -226,22 +226,22 @@ if ('onhashchange' in window) { 161 // Update MAYBE_CONVERT status in Run 162 // optimization: directly write results to only update first product when necessary 163 write_products = false; -164 if (tag == static_cast<int>(get_or_insert(Memory, base_address))) { +164 if (tag == static_cast<int>(get_or_insert(Memory, base_address))) { 165 ¦ const reagent& variant = variant_type(base, tag); 166 ¦ trace(9999, "mem") << "storing 1 in location " << status.value << end(); -167 ¦ put(Memory, status.value, 1); +167 ¦ put(Memory, status.value, 1); 168 ¦ if (!is_dummy(product)) { 169 ¦ ¦ // Write Memory in Successful MAYBE_CONVERT in Run 170 ¦ ¦ for (int i = 0; i < size_of(variant); ++i) { -171 ¦ ¦ ¦ double val = get_or_insert(Memory, base_address+/*skip tag*/1+i); +171 ¦ ¦ ¦ double val = get_or_insert(Memory, base_address+/*skip tag*/1+i); 172 ¦ ¦ ¦ trace(9999, "mem") << "storing " << no_scientific(val) << " in location " << product.value+i << end(); -173 ¦ ¦ ¦ put(Memory, product.value+i, val); +173 ¦ ¦ ¦ put(Memory, product.value+i, val); 174 ¦ ¦ } 175 ¦ } 176 } 177 else { 178 ¦ trace(9999, "mem") << "storing 0 in location " << status.value << end(); -179 ¦ put(Memory, status.value, 0); +179 ¦ put(Memory, status.value, 0); 180 } 181 break; 182 } @@ -393,7 +393,7 @@ if ('onhashchange' in window) { 328 } 329 reagent/*copy*/ ingredient = ingredients.at(ingredient_index); // unnecessary copy just to keep this function from modifying caller 330 populate_value(ingredient); -331 if (ingredient.value >= SIZE(container_info.elements)) { +331 if (ingredient.value >= SIZE(container_info.elements)) { 332 ¦ raise << maybe(caller.name) << "invalid tag at " << ingredient_index << " for '" << container_info.name << "' in '" << to_original_string(inst) << "'\n" << end(); 333 ¦ return; 334 } @@ -502,7 +502,7 @@ if ('onhashchange' in window) { 437 //: Since the different variants of an exclusive-container might have 438 //: different sizes, relax the size mismatch check for 'merge' instructions. 439 :(before "End size_mismatch(x) Special-cases") -440 if (current_step_index() < SIZE(Current_routine->steps()) +440 if (current_step_index() < SIZE(Current_routine->steps()) 441 ¦ && current_instruction().operation == MERGE 442 ¦ && !current_instruction().products.empty() 443 ¦ && current_instruction().products.at(0).type) { @@ -511,7 +511,7 @@ if ('onhashchange' in window) { 446 const type_tree* root_type = x.type->atom ? x.type : x.type->left; 447 assert(root_type->atom); 448 if (get(Type, root_type->value).kind == EXCLUSIVE_CONTAINER) -449 ¦ return size_of(x) < SIZE(data); +449 ¦ return size_of(x) < SIZE(data); 450 } 451 452 :(scenario merge_exclusive_container_with_mismatched_sizes) -- cgit 1.4.1-2-gfad0