From 1c2d788b454670bf8fa1cb65c6251a8ff6ddcaf7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 19 Jun 2017 11:29:20 -0700 Subject: 3927 --- html/057immutable.cc.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'html/057immutable.cc.html') diff --git a/html/057immutable.cc.html b/html/057immutable.cc.html index e1109712..ed754bd0 100644 --- a/html/057immutable.cc.html +++ b/html/057immutable.cc.html @@ -408,7 +408,7 @@ if ('onhashchange' in window) { 344 // b) we never call 'put' or 'put-index' on it, and 345 // c) any non-primitive recipe calls in the body aren't returning it as a product 346 const recipe& caller = get(Recipe, r); -347 trace(9991, "transform") << "--- check mutability of ingredients in recipe " << caller.name << end(); +347 trace(9991, "transform") << "--- check mutability of ingredients in recipe " << caller.name << end(); 348 if (!caller.has_header) return; // skip check for old-style recipes calling next-ingredient directly 349 for (int i = 0; i < SIZE(caller.ingredients); ++i) { 350 ¦ const reagent& current_ingredient = caller.ingredients.at(i); @@ -431,7 +431,7 @@ if ('onhashchange' in window) { 367 ¦ // primitive recipe 368 ¦ switch (inst.operation) { 369 ¦ ¦ case COPY: -370 ¦ ¦ ¦ for (set<int>::iterator p = current_ingredient_indices.begin(); p != current_ingredient_indices.end(); ++p) +370 ¦ ¦ ¦ for (set<int>::iterator p = current_ingredient_indices.begin(); p != current_ingredient_indices.end(); ++p) 371 ¦ ¦ ¦ ¦ current_ingredient_and_aliases.insert(inst.products.at(*p).name); 372 ¦ ¦ ¦ break; 373 ¦ ¦ case GET: @@ -449,7 +449,7 @@ if ('onhashchange' in window) { 385 else { 386 ¦ // defined recipe 387 ¦ set<int> contained_in_product_indices = scan_contained_in_product_indices(inst, current_ingredient_indices); -388 ¦ for (set<int>::iterator p = contained_in_product_indices.begin(); p != contained_in_product_indices.end(); ++p) { +388 ¦ for (set<int>::iterator p = contained_in_product_indices.begin(); p != contained_in_product_indices.end(); ++p) { 389 ¦ ¦ if (*p < SIZE(inst.products)) 390 ¦ ¦ ¦ current_ingredient_and_aliases.insert(inst.products.at(*p)); 391 ¦ } @@ -459,7 +459,7 @@ if ('onhashchange' in window) { 395 set<int> scan_contained_in_product_indices(const instruction& inst, set<int>& ingredient_indices) { 396 set<reagent> selected_ingredients; 397 const recipe& callee = get(Recipe, inst.operation); -398 for (set<int>::iterator p = ingredient_indices.begin(); p != ingredient_indices.end(); ++p) { +398 for (set<int>::iterator p = ingredient_indices.begin(); p != ingredient_indices.end(); ++p) { 399 ¦ if (*p >= SIZE(callee.ingredients)) continue; // optional immutable ingredient 400 ¦ selected_ingredients.insert(callee.ingredients.at(*p)); 401 } @@ -467,7 +467,7 @@ if ('onhashchange' in window) { 403 for (int i = 0; i < SIZE(callee.products); ++i) { 404 ¦ const reagent& current_product = callee.products.at(i); 405 ¦ const string_tree* contained_in_name = property(current_product, "contained-in"); -406 ¦ if (contained_in_name && selected_ingredients.find(contained_in_name->value) != selected_ingredients.end()) +406 ¦ if (contained_in_name && selected_ingredients.find(contained_in_name->value) != selected_ingredients.end()) 407 ¦ ¦ result.insert(i); 408 } 409 return result; @@ -503,19 +503,19 @@ if ('onhashchange' in window) { 439 // first check if the instruction is directly modifying something it shouldn't 440 for (int i = 0; i < SIZE(inst.products); ++i) { 441 ¦ if (has_property(inst.products.at(i), "lookup") -442 ¦ ¦ ¦ && current_ingredient_and_aliases.find(inst.products.at(i)) != current_ingredient_and_aliases.end()) { +442 ¦ ¦ ¦ && current_ingredient_and_aliases.find(inst.products.at(i)) != current_ingredient_and_aliases.end()) { 443 ¦ ¦ string current_product_name = inst.products.at(i).name; 444 ¦ ¦ if (current_product_name == original_ingredient_name) 445 ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_product_name << "' in instruction '" << to_original_string(inst) << "' because it's an ingredient of recipe " << caller.name << " but not also a product\n" << end(); 446 ¦ ¦ else -447 ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_product_name << "' in instruction '" << to_original_string(inst) << "' because that would modify " << original_ingredient_name << " which is an ingredient of recipe " << caller.name << " but not also a product\n" << end(); +447 ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_product_name << "' in instruction '" << to_original_string(inst) << "' because that would modify " << original_ingredient_name << " which is an ingredient of recipe " << caller.name << " but not also a product\n" << end(); 448 ¦ ¦ return; 449 ¦ } 450 } 451 // check if there's any indirect modification going on 452 set<int> current_ingredient_indices = ingredient_indices(inst, current_ingredient_and_aliases); 453 if (current_ingredient_indices.empty()) return; // ingredient not found in call -454 for (set<int>::iterator p = current_ingredient_indices.begin(); p != current_ingredient_indices.end(); ++p) { +454 for (set<int>::iterator p = current_ingredient_indices.begin(); p != current_ingredient_indices.end(); ++p) { 455 ¦ const int current_ingredient_index = *p; 456 ¦ reagent current_ingredient = inst.ingredients.at(current_ingredient_index); 457 ¦ canonize_type(current_ingredient); @@ -531,7 +531,7 @@ if ('onhashchange' in window) { 467 ¦ ¦ ¦ ¦ if (current_ingredient_name == original_ingredient_name) 468 ¦ ¦ ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_ingredient_name << "' in instruction '" << to_original_string(inst) << "' because it's an ingredient of recipe " << caller.name << " but not also a product\n" << end(); 469 ¦ ¦ ¦ ¦ else -470 ¦ ¦ ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_ingredient_name << "' in instruction '" << to_original_string(inst) << "' because that would modify '" << original_ingredient_name << "' which is an ingredient of recipe " << caller.name << " but not also a product\n" << end(); +470 ¦ ¦ ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_ingredient_name << "' in instruction '" << to_original_string(inst) << "' because that would modify '" << original_ingredient_name << "' which is an ingredient of recipe " << caller.name << " but not also a product\n" << end(); 471 ¦ ¦ ¦ } 472 ¦ ¦ } 473 ¦ } @@ -541,7 +541,7 @@ if ('onhashchange' in window) { 477 ¦ ¦ ¦ if (current_ingredient_name == original_ingredient_name) 478 ¦ ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_ingredient_name << "' in instruction '" << to_original_string(inst) << "' because it's an ingredient of recipe " << caller.name << " but not also a product\n" << end(); 479 ¦ ¦ ¦ else -480 ¦ ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_ingredient_name << "' in instruction '" << to_original_string(inst) << "' because that would modify '" << original_ingredient_name << "' which is an ingredient of recipe " << caller.name << " but not also a product\n" << end(); +480 ¦ ¦ ¦ ¦ raise << maybe(caller.name) << "cannot modify '" << current_ingredient_name << "' in instruction '" << to_original_string(inst) << "' because that would modify '" << original_ingredient_name << "' which is an ingredient of recipe " << caller.name << " but not also a product\n" << end(); 481 ¦ ¦ } 482 ¦ } 483 } @@ -569,7 +569,7 @@ if ('onhashchange' in window) { 505 set<int> result; 506 for (int i = 0; i < SIZE(inst.ingredients); ++i) { 507 ¦ if (is_literal(inst.ingredients.at(i))) continue; -508 ¦ if (ingredient_names.find(inst.ingredients.at(i)) != ingredient_names.end()) +508 ¦ if (ingredient_names.find(inst.ingredients.at(i)) != ingredient_names.end()) 509 ¦ ¦ result.insert(i); 510 } 511 return result; @@ -621,7 +621,7 @@ if ('onhashchange' in window) { 557 if (!tmp->atom 558 ¦ ¦ || (!is_present_in_ingredients(caller, tmp->value) 559 ¦ ¦ ¦ ¦ && !is_present_in_products(caller, tmp->value))) { -560 ¦ raise << maybe(caller.name) << "/contained-in can only point to another ingredient or product, but got '" << to_string(property(current_ingredient, "contained-in")) << "'\n" << end(); +560 ¦ raise << maybe(caller.name) << "/contained-in can only point to another ingredient or product, but got '" << to_string(property(current_ingredient, "contained-in")) << "'\n" << end(); 561 } 562 continue; 563 } -- cgit 1.4.1-2-gfad0