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/025compare.cc.html | 209 ++++++++++++++++++++++++------------------------ 1 file changed, 104 insertions(+), 105 deletions(-) (limited to 'html/025compare.cc.html') diff --git a/html/025compare.cc.html b/html/025compare.cc.html index e3b71636..5bfd2d97 100644 --- a/html/025compare.cc.html +++ b/html/025compare.cc.html @@ -15,18 +15,17 @@ 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; } -.Special { color: #c00000; } -.Conceal { color: #4e4e4e; } .traceContains { color: #008000; } .LineNr { color: #444444; } -.Identifier { color: #c0a020; } .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; } .cSpecial { color: #008000; } -.muRecipe { color: #ff8700; } --> @@ -70,23 +69,23 @@ if ('onhashchange' in window) { 7 :(before "End Primitive Recipe Checks") 8 case EQUAL: { 9 if (SIZE(inst.ingredients) <= 1) { - 10 ¦ raise << maybe(get(Recipe, r).name) << "'equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); - 11 ¦ break; + 10 raise << maybe(get(Recipe, r).name) << "'equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); + 11 break; 12 } 13 const reagent& exemplar = inst.ingredients.at(0); 14 for (int i = /*skip exemplar*/1; i < SIZE(inst.ingredients); ++i) { - 15 ¦ if (!types_match(inst.ingredients.at(i), exemplar) && !types_match(exemplar, inst.ingredients.at(i))) { - 16 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'equal' expects ingredients to be all of the same type, but got '" << to_original_string(inst) << "'\n" << end(); - 17 ¦ ¦ goto finish_checking_instruction; - 18 ¦ } + 15 if (!types_match(inst.ingredients.at(i), exemplar) && !types_match(exemplar, inst.ingredients.at(i))) { + 16 raise << maybe(get(Recipe, r).name) << "'equal' expects ingredients to be all of the same type, but got '" << to_original_string(inst) << "'\n" << end(); + 17 goto finish_checking_instruction; + 18 } 19 } 20 if (SIZE(inst.products) > 1) { - 21 ¦ raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); - 22 ¦ break; + 21 raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); + 22 break; 23 } 24 if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { - 25 ¦ raise << maybe(get(Recipe, r).name) << "'equal' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); - 26 ¦ break; + 25 raise << maybe(get(Recipe, r).name) << "'equal' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); + 26 break; 27 } 28 break; 29 } @@ -95,10 +94,10 @@ if ('onhashchange' in window) { 32 vector<double>& exemplar = ingredients.at(0); 33 bool result = true; 34 for (int i = /*skip exemplar*/1; i < SIZE(ingredients); ++i) { - 35 ¦ if (!equal(ingredients.at(i).begin(), ingredients.at(i).end(), exemplar.begin())) { - 36 ¦ ¦ result = false; - 37 ¦ ¦ break; - 38 ¦ } + 35 if (!equal(ingredients.at(i).begin(), ingredients.at(i).end(), exemplar.begin())) { + 36 result = false; + 37 break; + 38 } 39 } 40 products.resize(1); 41 products.at(0).push_back(result); @@ -144,21 +143,21 @@ if ('onhashchange' in window) { 81 :(before "End Primitive Recipe Checks") 82 case NOT_EQUAL: { 83 if (SIZE(inst.ingredients) != 2) { - 84 ¦ raise << maybe(get(Recipe, r).name) << "'equal' needs two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); - 85 ¦ break; + 84 raise << maybe(get(Recipe, r).name) << "'equal' needs two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); + 85 break; 86 } 87 const reagent& exemplar = inst.ingredients.at(0); 88 if (!types_match(inst.ingredients.at(1), exemplar) && !types_match(exemplar, inst.ingredients.at(1))) { - 89 ¦ raise << maybe(get(Recipe, r).name) << "'equal' expects ingredients to be all of the same type, but got '" << to_original_string(inst) << "'\n" << end(); - 90 ¦ goto finish_checking_instruction; + 89 raise << maybe(get(Recipe, r).name) << "'equal' expects ingredients to be all of the same type, but got '" << to_original_string(inst) << "'\n" << end(); + 90 goto finish_checking_instruction; 91 } 92 if (SIZE(inst.products) > 1) { - 93 ¦ raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); - 94 ¦ break; + 93 raise << maybe(get(Recipe, r).name) << "'equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); + 94 break; 95 } 96 if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { - 97 ¦ raise << maybe(get(Recipe, r).name) << "'equal' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); - 98 ¦ break; + 97 raise << maybe(get(Recipe, r).name) << "'equal' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); + 98 break; 99 } 100 break; 101 } @@ -198,22 +197,22 @@ if ('onhashchange' in window) { 135 :(before "End Primitive Recipe Checks") 136 case GREATER_THAN: { 137 if (SIZE(inst.ingredients) <= 1) { -138 ¦ raise << maybe(get(Recipe, r).name) << "'greater-than' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); -139 ¦ break; +138 raise << maybe(get(Recipe, r).name) << "'greater-than' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); +139 break; 140 } 141 for (int i = 0; i < SIZE(inst.ingredients); ++i) { -142 ¦ if (!is_mu_number(inst.ingredients.at(i))) { -143 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'greater-than' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); -144 ¦ ¦ goto finish_checking_instruction; -145 ¦ } +142 if (!is_mu_number(inst.ingredients.at(i))) { +143 raise << maybe(get(Recipe, r).name) << "'greater-than' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); +144 goto finish_checking_instruction; +145 } 146 } 147 if (SIZE(inst.products) > 1) { -148 ¦ raise << maybe(get(Recipe, r).name) << "'greater-than' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); -149 ¦ break; +148 raise << maybe(get(Recipe, r).name) << "'greater-than' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); +149 break; 150 } 151 if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { -152 ¦ raise << maybe(get(Recipe, r).name) << "'greater-than' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); -153 ¦ break; +152 raise << maybe(get(Recipe, r).name) << "'greater-than' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); +153 break; 154 } 155 break; 156 } @@ -221,9 +220,9 @@ if ('onhashchange' in window) { 158 case GREATER_THAN: { 159 bool result = true; 160 for (int i = /**/1; i < SIZE(ingredients); ++i) { -161 ¦ if (ingredients.at(i-1).at(0) <= ingredients.at(i).at(0)) { -162 ¦ ¦ result = false; -163 ¦ } +161 if (ingredients.at(i-1).at(0) <= ingredients.at(i).at(0)) { +162 result = false; +163 } 164 } 165 products.resize(1); 166 products.at(0).push_back(result); @@ -265,22 +264,22 @@ if ('onhashchange' in window) { 202 :(before "End Primitive Recipe Checks") 203 case LESSER_THAN: { 204 if (SIZE(inst.ingredients) <= 1) { -205 ¦ raise << maybe(get(Recipe, r).name) << "'lesser-than' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); -206 ¦ break; +205 raise << maybe(get(Recipe, r).name) << "'lesser-than' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); +206 break; 207 } 208 for (int i = 0; i < SIZE(inst.ingredients); ++i) { -209 ¦ if (!is_mu_number(inst.ingredients.at(i))) { -210 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'lesser-than' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); -211 ¦ ¦ goto finish_checking_instruction; -212 ¦ } +209 if (!is_mu_number(inst.ingredients.at(i))) { +210 raise << maybe(get(Recipe, r).name) << "'lesser-than' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); +211 goto finish_checking_instruction; +212 } 213 } 214 if (SIZE(inst.products) > 1) { -215 ¦ raise << maybe(get(Recipe, r).name) << "'lesser-than' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); -216 ¦ break; +215 raise << maybe(get(Recipe, r).name) << "'lesser-than' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); +216 break; 217 } 218 if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { -219 ¦ raise << maybe(get(Recipe, r).name) << "'lesser-than' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); -220 ¦ break; +219 raise << maybe(get(Recipe, r).name) << "'lesser-than' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); +220 break; 221 } 222 break; 223 } @@ -288,9 +287,9 @@ if ('onhashchange' in window) { 225 case LESSER_THAN: { 226 bool result = true; 227 for (int i = /**/1; i < SIZE(ingredients); ++i) { -228 ¦ if (ingredients.at(i-1).at(0) >= ingredients.at(i).at(0)) { -229 ¦ ¦ result = false; -230 ¦ } +228 if (ingredients.at(i-1).at(0) >= ingredients.at(i).at(0)) { +229 result = false; +230 } 231 } 232 products.resize(1); 233 products.at(0).push_back(result); @@ -332,22 +331,22 @@ if ('onhashchange' in window) { 269 :(before "End Primitive Recipe Checks") 270 case GREATER_OR_EQUAL: { 271 if (SIZE(inst.ingredients) <= 1) { -272 ¦ raise << maybe(get(Recipe, r).name) << "'greater-or-equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); -273 ¦ break; +272 raise << maybe(get(Recipe, r).name) << "'greater-or-equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); +273 break; 274 } 275 for (int i = 0; i < SIZE(inst.ingredients); ++i) { -276 ¦ if (!is_mu_number(inst.ingredients.at(i))) { -277 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'greater-or-equal' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); -278 ¦ ¦ goto finish_checking_instruction; -279 ¦ } +276 if (!is_mu_number(inst.ingredients.at(i))) { +277 raise << maybe(get(Recipe, r).name) << "'greater-or-equal' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); +278 goto finish_checking_instruction; +279 } 280 } 281 if (SIZE(inst.products) > 1) { -282 ¦ raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); -283 ¦ break; +282 raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); +283 break; 284 } 285 if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { -286 ¦ raise << maybe(get(Recipe, r).name) << "'greater-or-equal' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); -287 ¦ break; +286 raise << maybe(get(Recipe, r).name) << "'greater-or-equal' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); +287 break; 288 } 289 break; 290 } @@ -355,9 +354,9 @@ if ('onhashchange' in window) { 292 case GREATER_OR_EQUAL: { 293 bool result = true; 294 for (int i = /**/1; i < SIZE(ingredients); ++i) { -295 ¦ if (ingredients.at(i-1).at(0) < ingredients.at(i).at(0)) { -296 ¦ ¦ result = false; -297 ¦ } +295 if (ingredients.at(i-1).at(0) < ingredients.at(i).at(0)) { +296 result = false; +297 } 298 } 299 products.resize(1); 300 products.at(0).push_back(result); @@ -407,22 +406,22 @@ if ('onhashchange' in window) { 344 :(before "End Primitive Recipe Checks") 345 case LESSER_OR_EQUAL: { 346 if (SIZE(inst.ingredients) <= 1) { -347 ¦ raise << maybe(get(Recipe, r).name) << "'lesser-or-equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); -348 ¦ break; +347 raise << maybe(get(Recipe, r).name) << "'lesser-or-equal' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); +348 break; 349 } 350 for (int i = 0; i < SIZE(inst.ingredients); ++i) { -351 ¦ if (!is_mu_number(inst.ingredients.at(i))) { -352 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'lesser-or-equal' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); -353 ¦ ¦ goto finish_checking_instruction; -354 ¦ } +351 if (!is_mu_number(inst.ingredients.at(i))) { +352 raise << maybe(get(Recipe, r).name) << "'lesser-or-equal' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); +353 goto finish_checking_instruction; +354 } 355 } 356 if (SIZE(inst.products) > 1) { -357 ¦ raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); -358 ¦ break; +357 raise << maybe(get(Recipe, r).name) << "'greater-or-equal' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); +358 break; 359 } 360 if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_boolean(inst.products.at(0))) { -361 ¦ raise << maybe(get(Recipe, r).name) << "'greater-or-equal' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); -362 ¦ break; +361 raise << maybe(get(Recipe, r).name) << "'greater-or-equal' should yield a boolean, but got '" << inst.products.at(0).original_string << "'\n" << end(); +362 break; 363 } 364 break; 365 } @@ -430,9 +429,9 @@ if ('onhashchange' in window) { 367 case LESSER_OR_EQUAL: { 368 bool result = true; 369 for (int i = /**/1; i < SIZE(ingredients); ++i) { -370 ¦ if (ingredients.at(i-1).at(0) > ingredients.at(i).at(0)) { -371 ¦ ¦ result = false; -372 ¦ } +370 if (ingredients.at(i-1).at(0) > ingredients.at(i).at(0)) { +371 result = false; +372 } 373 } 374 products.resize(1); 375 products.at(0).push_back(result); @@ -482,22 +481,22 @@ if ('onhashchange' in window) { 419 :(before "End Primitive Recipe Checks") 420 case MAX: { 421 if (SIZE(inst.ingredients) <= 1) { -422 ¦ raise << maybe(get(Recipe, r).name) << "'max' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); -423 ¦ break; +422 raise << maybe(get(Recipe, r).name) << "'max' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); +423 break; 424 } 425 for (int i = 0; i < SIZE(inst.ingredients); ++i) { -426 ¦ if (!is_mu_number(inst.ingredients.at(i))) { -427 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'max' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); -428 ¦ ¦ goto finish_checking_instruction; -429 ¦ } +426 if (!is_mu_number(inst.ingredients.at(i))) { +427 raise << maybe(get(Recipe, r).name) << "'max' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); +428 goto finish_checking_instruction; +429 } 430 } 431 if (SIZE(inst.products) > 1) { -432 ¦ raise << maybe(get(Recipe, r).name) << "'max' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); -433 ¦ break; +432 raise << maybe(get(Recipe, r).name) << "'max' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); +433 break; 434 } 435 if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_number(inst.products.at(0))) { -436 ¦ raise << maybe(get(Recipe, r).name) << "'max' should yield a number, but got '" << inst.products.at(0).original_string << "'\n" << end(); -437 ¦ break; +436 raise << maybe(get(Recipe, r).name) << "'max' should yield a number, but got '" << inst.products.at(0).original_string << "'\n" << end(); +437 break; 438 } 439 break; 440 } @@ -505,9 +504,9 @@ if ('onhashchange' in window) { 442 case MAX: { 443 int result = ingredients.at(0).at(0); 444 for (int i = /**/1; i < SIZE(ingredients); ++i) { -445 ¦ if (ingredients.at(i).at(0) > result) { -446 ¦ ¦ result = ingredients.at(i).at(0); -447 ¦ } +445 if (ingredients.at(i).at(0) > result) { +446 result = ingredients.at(i).at(0); +447 } 448 } 449 products.resize(1); 450 products.at(0).push_back(result); @@ -521,22 +520,22 @@ if ('onhashchange' in window) { 458 :(before "End Primitive Recipe Checks") 459 case MIN: { 460 if (SIZE(inst.ingredients) <= 1) { -461 ¦ raise << maybe(get(Recipe, r).name) << "'min' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); -462 ¦ break; +461 raise << maybe(get(Recipe, r).name) << "'min' needs at least two ingredients to compare in '" << to_original_string(inst) << "'\n" << end(); +462 break; 463 } 464 for (int i = 0; i < SIZE(inst.ingredients); ++i) { -465 ¦ if (!is_mu_number(inst.ingredients.at(i))) { -466 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'min' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); -467 ¦ ¦ goto finish_checking_instruction; -468 ¦ } +465 if (!is_mu_number(inst.ingredients.at(i))) { +466 raise << maybe(get(Recipe, r).name) << "'min' can only compare numbers; got '" << inst.ingredients.at(i).original_string << "'\n" << end(); +467 goto finish_checking_instruction; +468 } 469 } 470 if (SIZE(inst.products) > 1) { -471 ¦ raise << maybe(get(Recipe, r).name) << "'min' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); -472 ¦ break; +471 raise << maybe(get(Recipe, r).name) << "'min' yields exactly one product in '" << to_original_string(inst) << "'\n" << end(); +472 break; 473 } 474 if (!inst.products.empty() && !is_dummy(inst.products.at(0)) && !is_mu_number(inst.products.at(0))) { -475 ¦ raise << maybe(get(Recipe, r).name) << "'min' should yield a number, but got '" << inst.products.at(0).original_string << "'\n" << end(); -476 ¦ break; +475 raise << maybe(get(Recipe, r).name) << "'min' should yield a number, but got '" << inst.products.at(0).original_string << "'\n" << end(); +476 break; 477 } 478 break; 479 } @@ -544,9 +543,9 @@ if ('onhashchange' in window) { 481 case MIN: { 482 int result = ingredients.at(0).at(0); 483 for (int i = /**/1; i < SIZE(ingredients); ++i) { -484 ¦ if (ingredients.at(i).at(0) < result) { -485 ¦ ¦ result = ingredients.at(i).at(0); -486 ¦ } +484 if (ingredients.at(i).at(0) < result) { +485 result = ingredients.at(i).at(0); +486 } 487 } 488 products.resize(1); 489 products.at(0).push_back(result); -- cgit 1.4.1-2-gfad0