From fd7d8138a4ff5515f9b79c584a98d5c26d8ddb8a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 2 Mar 2017 05:48:01 -0800 Subject: 3750 --- html/053recipe_header.cc.html | 60 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'html/053recipe_header.cc.html') diff --git a/html/053recipe_header.cc.html b/html/053recipe_header.cc.html index 713dc04e..ad21220a 100644 --- a/html/053recipe_header.cc.html +++ b/html/053recipe_header.cc.html @@ -88,7 +88,7 @@ if ('onhashchange' in window) { 24 25 :(before "End Recipe Refinements") 26 if (in.peek() != '[') { - 27 trace(9999, "parse") << "recipe has a header; parsing" << end(); + 27 trace(9999, "parse") << "recipe has a header; parsing" << end(); 28 load_recipe_header(in, result); 29 } 30 @@ -99,25 +99,25 @@ if ('onhashchange' in window) { 35 string s = next_word(in); 36 if (s.empty()) { 37 assert(!has_data(in)); - 38 raise << "incomplete recipe header at end of file (0)\n" << end(); + 38 raise << "incomplete recipe header at end of file (0)\n" << end(); 39 return; 40 } 41 if (s == "<-") - 42 raise << "recipe " << result.name << " should say '->' and not '<-'\n" << end(); + 42 raise << "recipe " << result.name << " should say '->' and not '<-'\n" << end(); 43 if (s == "->") break; 44 result.ingredients.push_back(reagent(s)); - 45 trace(9999, "parse") << "header ingredient: " << result.ingredients.back().original_string << end(); + 45 trace(9999, "parse") << "header ingredient: " << result.ingredients.back().original_string << end(); 46 skip_whitespace_but_not_newline(in); 47 } 48 while (has_data(in) && in.peek() != '[' && in.peek() != '\n') { 49 string s = next_word(in); 50 if (s.empty()) { 51 assert(!has_data(in)); - 52 raise << "incomplete recipe header at end of file (1)\n" << end(); + 52 raise << "incomplete recipe header at end of file (1)\n" << end(); 53 return; 54 } 55 result.products.push_back(reagent(s)); - 56 trace(9999, "parse") << "header product: " << result.products.back().original_string << end(); + 56 trace(9999, "parse") << "header product: " << result.products.back().original_string << end(); 57 skip_whitespace_but_not_newline(in); 58 } 59 // End Load Recipe Header(result) @@ -213,7 +213,7 @@ if ('onhashchange' in window) { 149 } 150 } 151 if (result.has_header) { -152 trace(9999, "parse") << "recipe " << result.name << " has a header" << end(); +152 trace(9999, "parse") << "recipe " << result.name << " has a header" << end(); 153 } 154 155 //: Support type abbreviations in headers. @@ -252,7 +252,7 @@ if ('onhashchange' in window) { 188 } 189 } 190 if (curr.name == "next-ingredient-without-typechecking") { -191 raise << maybe(result.name) << "never call 'next-ingredient-without-typechecking' directly\n" << end(); +191 raise << maybe(result.name) << "never call 'next-ingredient-without-typechecking' directly\n" << end(); 192 curr.clear(); 193 } 194 @@ -297,7 +297,7 @@ if ('onhashchange' in window) { 233 234 :(after "use-before-set Error") 235 if (is_present_in_ingredients(caller, ingredient.name)) -236 raise << " did you forget 'load-ingredients'?\n" << end(); +236 raise << " did you forget 'load-ingredients'?\n" << end(); 237 238 :(scenario load_ingredients_missing_error_2) 239 % Hide_errors = true; @@ -310,7 +310,7 @@ if ('onhashchange' in window) { 246 247 :(after "missing-type Error 1") 248 if (is_present_in_ingredients(get(Recipe, get(Recipe_ordinal, recipe_name)), x.name)) -249 raise << " did you forget 'load-ingredients'?\n" << end(); +249 raise << " did you forget 'load-ingredients'?\n" << end(); 250 251 :(code) 252 bool is_present_in_ingredients(const recipe& callee, const string& ingredient_name) { @@ -352,7 +352,7 @@ if ('onhashchange' in window) { 288 :(code) 289 void check_calls_against_header(const recipe_ordinal r) { 290 const recipe& caller = get(Recipe, r); -291 trace(9991, "transform") << "--- type-check calls inside recipe " << caller.name << end(); +291 trace(9991, "transform") << "--- type-check calls inside recipe " << caller.name << end(); 292 for (int i = 0; i < SIZE(caller.steps); ++i) { 293 const instruction& inst = caller.steps.at(i); 294 if (inst.operation < MAX_PRIMITIVE_RECIPES) continue; @@ -361,13 +361,13 @@ if ('onhashchange' in window) { 297 for (long int i = 0; i < min(SIZE(inst.ingredients), SIZE(callee.ingredients)); ++i) { 298 // ingredients coerced from call to callee 299 if (!types_coercible(callee.ingredients.at(i), inst.ingredients.at(i))) -300 raise << maybe(caller.name) << "ingredient " << i << " has the wrong type at '" << inst.original_string << "'\n" << end(); +300 raise << maybe(caller.name) << "ingredient " << i << " has the wrong type at '" << inst.original_string << "'\n" << end(); 301 } 302 for (long int i = 0; i < min(SIZE(inst.products), SIZE(callee.products)); ++i) { 303 if (is_dummy(inst.products.at(i))) continue; 304 // products coerced from callee to call 305 if (!types_coercible(inst.products.at(i), callee.products.at(i))) -306 raise << maybe(caller.name) << "product " << i << " has the wrong type at '" << inst.original_string << "'\n" << end(); +306 raise << maybe(caller.name) << "product " << i << " has the wrong type at '" << inst.original_string << "'\n" << end(); 307 } 308 } 309 } @@ -392,17 +392,17 @@ if ('onhashchange' in window) { 328 void check_return_instructions_against_header(const recipe_ordinal r) { 329 const recipe& caller_recipe = get(Recipe, r); 330 if (!caller_recipe.has_header) return; -331 trace(9991, "transform") << "--- checking return instructions against header for " << caller_recipe.name << end(); +331 trace(9991, "transform") << "--- checking return instructions against header for " << caller_recipe.name << end(); 332 for (int i = 0; i < SIZE(caller_recipe.steps); ++i) { 333 const instruction& inst = caller_recipe.steps.at(i); 334 if (inst.name != "reply" && inst.name != "return") continue; 335 if (SIZE(caller_recipe.products) != SIZE(inst.ingredients)) { -336 raise << maybe(caller_recipe.name) << "replied with the wrong number of products at '" << inst.original_string << "'\n" << end(); +336 raise << maybe(caller_recipe.name) << "replied with the wrong number of products at '" << inst.original_string << "'\n" << end(); 337 continue; 338 } 339 for (int i = 0; i < SIZE(caller_recipe.products); ++i) { 340 if (!types_match(caller_recipe.products.at(i), inst.ingredients.at(i))) -341 raise << maybe(caller_recipe.name) << "replied with the wrong type at '" << inst.original_string << "'\n" << end(); +341 raise << maybe(caller_recipe.name) << "replied with the wrong type at '" << inst.original_string << "'\n" << end(); 342 } 343 } 344 } @@ -447,10 +447,10 @@ if ('onhashchange' in window) { 383 recipe& caller_recipe = get(Recipe, r); 384 if (caller_recipe.products.empty()) return; 385 caller_recipe.ingredient_index.clear(); -386 trace(9991, "transform") << "--- checking return instructions against header for " << caller_recipe.name << end(); +386 trace(9991, "transform") << "--- checking return instructions against header for " << caller_recipe.name << end(); 387 for (int i = 0; i < SIZE(caller_recipe.ingredients); ++i) { 388 if (contains_key(caller_recipe.ingredient_index, caller_recipe.ingredients.at(i).name)) -389 raise << maybe(caller_recipe.name) << "'" << caller_recipe.ingredients.at(i).name << "' can't repeat in the ingredients\n" << end(); +389 raise << maybe(caller_recipe.name) << "'" << caller_recipe.ingredients.at(i).name << "' can't repeat in the ingredients\n" << end(); 390 put(caller_recipe.ingredient_index, caller_recipe.ingredients.at(i).name, i); 391 } 392 } @@ -477,37 +477,37 @@ if ('onhashchange' in window) { 413 void deduce_types_from_header(const recipe_ordinal r) { 414 recipe& caller_recipe = get(Recipe, r); 415 if (caller_recipe.products.empty()) return; -416 trace(9991, "transform") << "--- deduce types from header for " << caller_recipe.name << end(); +416 trace(9991, "transform") << "--- deduce types from header for " << caller_recipe.name << end(); 417 map<string, const type_tree*> header_type; 418 for (int i = 0; i < SIZE(caller_recipe.ingredients); ++i) { 419 if (!caller_recipe.ingredients.at(i).type) continue; // error handled elsewhere 420 put(header_type, caller_recipe.ingredients.at(i).name, caller_recipe.ingredients.at(i).type); -421 trace(9993, "transform") << "type of " << caller_recipe.ingredients.at(i).name << " is " << names_to_string(caller_recipe.ingredients.at(i).type) << end(); +421 trace(9993, "transform") << "type of " << caller_recipe.ingredients.at(i).name << " is " << names_to_string(caller_recipe.ingredients.at(i).type) << end(); 422 } 423 for (int i = 0; i < SIZE(caller_recipe.products); ++i) { 424 if (!caller_recipe.products.at(i).type) continue; // error handled elsewhere 425 put(header_type, caller_recipe.products.at(i).name, caller_recipe.products.at(i).type); -426 trace(9993, "transform") << "type of " << caller_recipe.products.at(i).name << " is " << names_to_string(caller_recipe.products.at(i).type) << end(); +426 trace(9993, "transform") << "type of " << caller_recipe.products.at(i).name << " is " << names_to_string(caller_recipe.products.at(i).type) << end(); 427 } 428 for (int i = 0; i < SIZE(caller_recipe.steps); ++i) { 429 instruction& inst = caller_recipe.steps.at(i); -430 trace(9992, "transform") << "instruction: " << to_string(inst) << end(); +430 trace(9992, "transform") << "instruction: " << to_string(inst) << end(); 431 for (int i = 0; i < SIZE(inst.ingredients); ++i) { 432 if (inst.ingredients.at(i).type) continue; -433 if (header_type.find(inst.ingredients.at(i).name) == header_type.end()) +433 if (header_type.find(inst.ingredients.at(i).name) == header_type.end()) 434 continue; 435 if (!contains_key(header_type, inst.ingredients.at(i).name)) continue; // error handled elsewhere 436 inst.ingredients.at(i).type = new type_tree(*get(header_type, inst.ingredients.at(i).name)); -437 trace(9993, "transform") << "type of " << inst.ingredients.at(i).name << " is " << names_to_string(inst.ingredients.at(i).type) << end(); +437 trace(9993, "transform") << "type of " << inst.ingredients.at(i).name << " is " << names_to_string(inst.ingredients.at(i).type) << end(); 438 } 439 for (int i = 0; i < SIZE(inst.products); ++i) { -440 trace(9993, "transform") << " product: " << to_string(inst.products.at(i)) << end(); +440 trace(9993, "transform") << " product: " << to_string(inst.products.at(i)) << end(); 441 if (inst.products.at(i).type) continue; -442 if (header_type.find(inst.products.at(i).name) == header_type.end()) +442 if (header_type.find(inst.products.at(i).name) == header_type.end()) 443 continue; 444 if (!contains_key(header_type, inst.products.at(i).name)) continue; // error handled elsewhere 445 inst.products.at(i).type = new type_tree(*get(header_type, inst.products.at(i).name)); -446 trace(9993, "transform") << "type of " << inst.products.at(i).name << " is " << names_to_string(inst.products.at(i).type) << end(); +446 trace(9993, "transform") << "type of " << inst.products.at(i).name << " is " << names_to_string(inst.products.at(i).type) << end(); 447 } 448 } 449 } @@ -534,7 +534,7 @@ if ('onhashchange' in window) { 470 void fill_in_return_ingredients(const recipe_ordinal r) { 471 recipe& caller_recipe = get(Recipe, r); 472 if (!caller_recipe.has_header) return; -473 trace(9991, "transform") << "--- fill in return ingredients from header for recipe " << caller_recipe.name << end(); +473 trace(9991, "transform") << "--- fill in return ingredients from header for recipe " << caller_recipe.name << end(); 474 for (int i = 0; i < SIZE(caller_recipe.steps); ++i) { 475 instruction& inst = caller_recipe.steps.at(i); 476 if (inst.name == "reply" || inst.name == "return") @@ -663,7 +663,7 @@ if ('onhashchange' in window) { 599 reagent/*local*/ expected_ingredient("x:address:array:character"); 600 for (int i = 0; i < SIZE(caller.ingredients); ++i) { 601 if (!types_strictly_match(expected_ingredient, caller.ingredients.at(i))) { -602 raise << "ingredients of recipe 'main' must all be text (address:array:character)\n" << end(); +602 raise << "ingredients of recipe 'main' must all be text (address:array:character)\n" << end(); 603 break; 604 } 605 } @@ -671,7 +671,7 @@ if ('onhashchange' in window) { 607 reagent/*local*/ expected_product("x:number"); 608 if (nprod > 1 609 || (nprod == 1 && !types_strictly_match(expected_product, caller.products.at(0)))) { -610 raise << "recipe 'main' must return at most a single product, a number\n" << end(); +610 raise << "recipe 'main' must return at most a single product, a number\n" << end(); 611 } 612 } 613 -- cgit 1.4.1-2-gfad0