From 9e751bb8c0cdf771d34c839cb6591d892b8e62de Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 7 Mar 2017 01:41:48 -0800 Subject: 3761 --- html/060rewrite_literal_string.cc.html | 53 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'html/060rewrite_literal_string.cc.html') diff --git a/html/060rewrite_literal_string.cc.html b/html/060rewrite_literal_string.cc.html index bccfbd07..50d77e90 100644 --- a/html/060rewrite_literal_string.cc.html +++ b/html/060rewrite_literal_string.cc.html @@ -16,14 +16,15 @@ a { text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } .Constant { color: #00a0a0; } -.Special { color: #c00000; } .muRecipe { color: #ff8700; } +.Conceal { color: #4e4e4e; } +.Special { color: #c00000; } .Comment { color: #9090ff; } .Delimiter { color: #800080; } .LineNr { color: #444444; } -.traceContains { color: #008000; } -.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .Identifier { color: #c0a020; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } +.traceContains { color: #008000; } --> @@ -99,35 +100,35 @@ if ('onhashchange' in window) { 39 if (contains_numeric_locations(caller)) return; 40 vector<instruction> new_instructions; 41 for (int i = 0; i < SIZE(caller.steps); ++i) { -42 instruction& inst = caller.steps.at(i); -43 if (recipes_taking_literal_strings.find(inst.name) == recipes_taking_literal_strings.end()) { -44 for (int j = 0; j < SIZE(inst.ingredients); ++j) { -45 if (!is_literal_text(inst.ingredients.at(j))) continue; -46 instruction def; -47 ostringstream ingredient_name; -48 ingredient_name << inst.name << '_' << i << '_' << j << ":text"; -49 def.name = "new"; -50 def.ingredients.push_back(inst.ingredients.at(j)); -51 def.products.push_back(reagent(ingredient_name.str())); -52 new_instructions.push_back(def); -53 inst.ingredients.at(j).clear(); // reclaim old memory -54 inst.ingredients.at(j) = reagent(ingredient_name.str()); -55 } -56 } -57 new_instructions.push_back(inst); +42 ¦ instruction& inst = caller.steps.at(i); +43 ¦ if (recipes_taking_literal_strings.find(inst.name) == recipes_taking_literal_strings.end()) { +44 ¦ ¦ for (int j = 0; j < SIZE(inst.ingredients); ++j) { +45 ¦ ¦ ¦ if (!is_literal_text(inst.ingredients.at(j))) continue; +46 ¦ ¦ ¦ instruction def; +47 ¦ ¦ ¦ ostringstream ingredient_name; +48 ¦ ¦ ¦ ingredient_name << inst.name << '_' << i << '_' << j << ":text"; +49 ¦ ¦ ¦ def.name = "new"; +50 ¦ ¦ ¦ def.ingredients.push_back(inst.ingredients.at(j)); +51 ¦ ¦ ¦ def.products.push_back(reagent(ingredient_name.str())); +52 ¦ ¦ ¦ new_instructions.push_back(def); +53 ¦ ¦ ¦ inst.ingredients.at(j).clear(); // reclaim old memory +54 ¦ ¦ ¦ inst.ingredients.at(j) = reagent(ingredient_name.str()); +55 ¦ ¦ } +56 ¦ } +57 ¦ new_instructions.push_back(inst); 58 } 59 caller.steps.swap(new_instructions); 60 } 61 62 bool contains_numeric_locations(const recipe& caller) { 63 for (int i = 0; i < SIZE(caller.steps); ++i) { -64 const instruction& inst = caller.steps.at(i); -65 for (int in = 0; in < SIZE(inst.ingredients); ++in) -66 if (is_numeric_location(inst.ingredients.at(in))) -67 return true; -68 for (int out = 0; out < SIZE(inst.products); ++out) -69 if (is_numeric_location(inst.products.at(out))) -70 return true; +64 ¦ const instruction& inst = caller.steps.at(i); +65 ¦ for (int in = 0; in < SIZE(inst.ingredients); ++in) +66 ¦ ¦ if (is_numeric_location(inst.ingredients.at(in))) +67 ¦ ¦ ¦ return true; +68 ¦ for (int out = 0; out < SIZE(inst.products); ++out) +69 ¦ ¦ if (is_numeric_location(inst.products.at(out))) +70 ¦ ¦ ¦ return true; 71 } 72 return false; 73 } -- cgit 1.4.1-2-gfad0