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/040brace.cc.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'html/040brace.cc.html') diff --git a/html/040brace.cc.html b/html/040brace.cc.html index 8d805128..1aa1339a 100644 --- a/html/040brace.cc.html +++ b/html/040brace.cc.html @@ -102,15 +102,15 @@ if ('onhashchange' in window) { 39 const int OPEN = 0, CLOSE = 1; 40 // use signed integer for step index because we'll be doing arithmetic on it 41 list<pair<int/*OPEN/CLOSE*/, /*step*/int> > braces; - 42 trace(9991, "transform") << "--- transform braces for recipe " << get(Recipe, r).name << end(); + 42 trace(9991, "transform") << "--- transform braces for recipe " << get(Recipe, r).name << end(); 43 for (int index = 0; index < SIZE(get(Recipe, r).steps); ++index) { 44 ¦ const instruction& inst = get(Recipe, r).steps.at(index); 45 ¦ if (inst.label == "{") { - 46 ¦ ¦ trace(9993, "transform") << maybe(get(Recipe, r).name) << "push (open, " << index << ")" << end(); + 46 ¦ ¦ trace(9993, "transform") << maybe(get(Recipe, r).name) << "push (open, " << index << ")" << end(); 47 ¦ ¦ braces.push_back(pair<int,int>(OPEN, index)); 48 ¦ } 49 ¦ if (inst.label == "}") { - 50 ¦ ¦ trace(9993, "transform") << "push (close, " << index << ")" << end(); + 50 ¦ ¦ trace(9993, "transform") << "push (close, " << index << ")" << end(); 51 ¦ ¦ braces.push_back(pair<int,int>(CLOSE, index)); 52 ¦ } 53 } @@ -123,7 +123,7 @@ if ('onhashchange' in window) { 60 ¦ } 61 ¦ if (inst.label == "}") { 62 ¦ ¦ if (open_braces.empty()) { - 63 ¦ ¦ ¦ raise << maybe(get(Recipe, r).name) << "unbalanced '}'\n" << end(); + 63 ¦ ¦ ¦ raise << maybe(get(Recipe, r).name) << "unbalanced '}'\n" << end(); 64 ¦ ¦ ¦ return; 65 ¦ ¦ } 66 ¦ ¦ open_braces.pop(); @@ -136,13 +136,13 @@ if ('onhashchange' in window) { 73 ¦ ¦ ¦ ¦&& inst.name != "break" 74 ¦ ¦ ¦ ¦&& inst.name != "break-if" 75 ¦ ¦ ¦ ¦&& inst.name != "break-unless") { - 76 ¦ ¦ trace(9992, "transform") << inst.name << " ..." << end(); + 76 ¦ ¦ trace(9992, "transform") << inst.name << " ..." << end(); 77 ¦ ¦ continue; 78 ¦ } 79 ¦ // check for errors 80 ¦ if (inst.name.find("-if") != string::npos || inst.name.find("-unless") != string::npos) { 81 ¦ ¦ if (inst.ingredients.empty()) { - 82 ¦ ¦ ¦ raise << maybe(get(Recipe, r).name) << "'" << inst.name << "' expects 1 or 2 ingredients, but got none\n" << end(); + 82 ¦ ¦ ¦ raise << maybe(get(Recipe, r).name) << "'" << inst.name << "' expects 1 or 2 ingredients, but got none\n" << end(); 83 ¦ ¦ ¦ continue; 84 ¦ ¦ } 85 ¦ } @@ -180,7 +180,7 @@ if ('onhashchange' in window) { 117 ¦ target.type = new type_tree("offset"); 118 ¦ target.set_value(0); 119 ¦ if (open_braces.empty()) -120 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'" << old_name << "' needs a '{' before\n" << end(); +120 ¦ ¦ raise << maybe(get(Recipe, r).name) << "'" << old_name << "' needs a '{' before\n" << end(); 121 ¦ else if (old_name.find("loop") != string::npos) 122 ¦ ¦ target.set_value(open_braces.top()-index); 123 ¦ else // break instruction @@ -198,12 +198,12 @@ if ('onhashchange' in window) { 135 // enable future signed arithmetic 136 int matching_brace(int index, const list<pair<int, int> >& braces, recipe_ordinal r) { 137 int stacksize = 0; -138 for (list<pair<int, int> >::const_iterator p = braces.begin(); p != braces.end(); ++p) { +138 for (list<pair<int, int> >::const_iterator p = braces.begin(); p != braces.end(); ++p) { 139 ¦ if (p->second < index) continue; 140 ¦ stacksize += (p->first ? 1 : -1); 141 ¦ if (stacksize == 0) return p->second; 142 } -143 raise << maybe(get(Recipe, r).name) << "unbalanced '{'\n" << end(); +143 raise << maybe(get(Recipe, r).name) << "unbalanced '{'\n" << end(); 144 return SIZE(get(Recipe, r).steps); // exit current routine 145 } 146 @@ -460,7 +460,7 @@ if ('onhashchange' in window) { 397 ¦ curr.clear(); 398 } 399 else { -400 ¦ raise << "'" << curr.name << "' never yields any products\n" << end(); +400 ¦ raise << "'" << curr.name << "' never yields any products\n" << end(); 401 } 402 } 403 // rewrite `return-unless a, b, c, ...` to @@ -476,7 +476,7 @@ if ('onhashchange' in window) { 413 ¦ curr.clear(); 414 } 415 else { -416 ¦ raise << "'" << curr.name << "' never yields any products\n" << end(); +416 ¦ raise << "'" << curr.name << "' never yields any products\n" << end(); 417 } 418 } 419 @@ -485,7 +485,7 @@ if ('onhashchange' in window) { 422 const vector<reagent>& ingredients = inst.ingredients; 423 reagent/*copy*/ condition = ingredients.at(0); 424 vector<reagent> return_ingredients; -425 copy(++ingredients.begin(), ingredients.end(), inserter(return_ingredients, return_ingredients.end())); +425 copy(++ingredients.begin(), ingredients.end(), inserter(return_ingredients, return_ingredients.end())); 426 427 // { 428 instruction open_label; open_label.is_label=true; open_label.label = "{"; -- cgit 1.4.1-2-gfad0