From a802f0cedc7b5580d746f46ae62fcf8074ae3c49 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 2 Mar 2017 04:41:24 -0800 Subject: 3749 --- html/040brace.cc.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'html/040brace.cc.html') diff --git a/html/040brace.cc.html b/html/040brace.cc.html index 41ac0d83..1964ef2e 100644 --- a/html/040brace.cc.html +++ b/html/040brace.cc.html @@ -100,15 +100,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 } @@ -121,7 +121,7 @@ if ('onhashchange' in window) { 60 } 61 if (inst.label == "}") { 62 if (open_braces.empty()) { - 63 raise << "missing '{' in '" << get(Recipe, r).name << "'\n" << end(); + 63 raise << "missing '{' in '" << get(Recipe, r).name << "'\n" << end(); 64 return; 65 } 66 open_braces.pop(); @@ -134,13 +134,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 << "'" << inst.name << "' expects 1 or 2 ingredients, but got none\n" << end(); + 82 raise << "'" << inst.name << "' expects 1 or 2 ingredients, but got none\n" << end(); 83 continue; 84 } 85 } @@ -162,14 +162,14 @@ if ('onhashchange' in window) { 101 if (inst.name.find("-if") != string::npos || inst.name.find("-unless") != string::npos) { 102 // conditional branches check arg 1 103 if (SIZE(inst.ingredients) > 1 && is_literal(inst.ingredients.at(1))) { -104 trace(9992, "transform") << inst.name << ' ' << inst.ingredients.at(1).name << ":offset" << end(); +104 trace(9992, "transform") << inst.name << ' ' << inst.ingredients.at(1).name << ":offset" << end(); 105 continue; 106 } 107 } 108 else { 109 // unconditional branches check arg 0 110 if (!inst.ingredients.empty() && is_literal(inst.ingredients.at(0))) { -111 trace(9992, "transform") << "jump " << inst.ingredients.at(0).name << ":offset" << end(); +111 trace(9992, "transform") << "jump " << inst.ingredients.at(0).name << ":offset" << end(); 112 continue; 113 } 114 } @@ -178,7 +178,7 @@ if ('onhashchange' in window) { 117 target.type = new type_tree("offset"); 118 target.set_value(0); 119 if (open_braces.empty()) -120 raise << "'" << old_name << "' needs a '{' before\n" << end(); +120 raise << "'" << 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 @@ -186,9 +186,9 @@ if ('onhashchange' in window) { 125 inst.ingredients.push_back(target); 126 // log computed target 127 if (inst.name == "jump") -128 trace(9992, "transform") << "jump " << no_scientific(target.value) << ":offset" << end(); +128 trace(9992, "transform") << "jump " << no_scientific(target.value) << ":offset" << end(); 129 else -130 trace(9992, "transform") << inst.name << ' ' << inst.ingredients.at(0).name << ", " << no_scientific(target.value) << ":offset" << end(); +130 trace(9992, "transform") << inst.name << ' ' << inst.ingredients.at(0).name << ", " << no_scientific(target.value) << ":offset" << end(); 131 } 132 } 133 @@ -196,12 +196,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 @@ -458,7 +458,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 @@ -474,7 +474,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 @@ -483,7 +483,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