about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-02-07 00:25:27 -0800
committerKartik K. Agaram <vc@akkartik.com>2017-02-07 00:25:27 -0800
commit85553e522cfd8cf6ecb9f8c6819bff044197502b (patch)
treeeae7c3e9ac3cffed4b6c7967f721768f64c151f6
parent598f1b5362eb799e40836ceeb5452c9ba937fd6c (diff)
downloadmu-85553e522cfd8cf6ecb9f8c6819bff044197502b.tar.gz
3747
-rw-r--r--043space.cc10
-rw-r--r--062convert_ingredients_to_text.cc2
-rw-r--r--html/043space.cc.html10
-rw-r--r--html/062convert_ingredients_to_text.cc.html2
4 files changed, 12 insertions, 12 deletions
diff --git a/043space.cc b/043space.cc
index 33c4bb09..879561ee 100644
--- a/043space.cc
+++ b/043space.cc
@@ -235,7 +235,7 @@ void try_reclaim_locals() {
   const recipe& exiting_recipe = get(Recipe, r);
   if (exiting_recipe.steps.empty()) return;
   const instruction& inst = exiting_recipe.steps.at(0);
-  if (inst.old_name != "local-scope") return;
+  if (inst.name_before_rewrite != "local-scope") return;
   // reclaim any local variables unless they're being returned
   vector<double> zeros;
   for (int i = /*leave default space for last*/1;  i < SIZE(exiting_recipe.steps);  ++i) {
@@ -261,11 +261,11 @@ void try_reclaim_locals() {
 //: Reclaiming local variables above requires remembering what name an
 //: instruction had before any rewrites or transforms.
 :(before "End instruction Fields")
-string old_name;
+string name_before_rewrite;
 :(before "End instruction Clear")
-old_name.clear();
+name_before_rewrite.clear();
 :(before "End next_instruction(curr)")
-curr->old_name = curr->name;  // before rewrite rules modify it
+curr->name_before_rewrite = curr->name;
 
 :(code)
 // is this reagent one of the values returned by the current (return) instruction?
@@ -298,7 +298,7 @@ bool should_update_refcounts_in_write_memory() {
   if (!contains_key(Recipe, inst.operation)) return true;
   const recipe& callee = get(Recipe, inst.operation);
   if (callee.steps.empty()) return true;
-  return callee.steps.at(0).old_name != "local-scope";  // callees that call local-scope are already dealt with before return
+  return callee.steps.at(0).name_before_rewrite != "local-scope";  // callees that call local-scope are already dealt with before return
 }
 
 bool caller_uses_product(int product_index) {
diff --git a/062convert_ingredients_to_text.cc b/062convert_ingredients_to_text.cc
index 94ff5df3..cf639b9e 100644
--- a/062convert_ingredients_to_text.cc
+++ b/062convert_ingredients_to_text.cc
@@ -86,7 +86,7 @@ void convert_ingredients_to_text(recipe& caller) {
         convert_ingredient_to_text(inst.ingredients.at(j), new_instructions, ingredient_name.str());
       }
     }
-    else if (inst.old_name == "append") {
+    else if (inst.name_before_rewrite == "append") {
       // override only variants that try to append to a string
       // Beware: this hack restricts how much 'append' can be overridden. Any
       // new variants that match:
diff --git a/html/043space.cc.html b/html/043space.cc.html
index 60bc5518..2cdff102 100644
--- a/html/043space.cc.html
+++ b/html/043space.cc.html
@@ -299,7 +299,7 @@ if ('onhashchange' in window) {
 <span id="L235" class="LineNr">235 </span>  <span class="Normal">const</span> recipe&amp; exiting_recipe = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">);</span>
 <span id="L236" class="LineNr">236 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>exiting_recipe<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span><span class="Delimiter">;</span>
 <span id="L237" class="LineNr">237 </span>  <span class="Normal">const</span> instruction&amp; inst = exiting_recipe<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span>
-<span id="L238" class="LineNr">238 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>old_name != <span class="Constant">&quot;local-scope&quot;</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span>
+<span id="L238" class="LineNr">238 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>name_before_rewrite != <span class="Constant">&quot;local-scope&quot;</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span>
 <span id="L239" class="LineNr">239 </span>  <span class="Comment">// reclaim any local variables unless they're being returned</span>
 <span id="L240" class="LineNr">240 </span>  vector&lt;<span class="Normal">double</span>&gt; zeros<span class="Delimiter">;</span>
 <span id="L241" class="LineNr">241 </span>  <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Comment">/*</span><span class="Comment">leave default space for last</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span>  i &lt; <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>exiting_recipe<span class="Delimiter">.</span>steps<span class="Delimiter">);</span>  ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
@@ -325,11 +325,11 @@ if ('onhashchange' in window) {
 <span id="L261" class="LineNr">261 </span><span class="Comment">//: Reclaiming local variables above requires remembering what name an</span>
 <span id="L262" class="LineNr">262 </span><span class="Comment">//: instruction had before any rewrites or transforms.</span>
 <span id="L263" class="LineNr">263 </span><span class="Delimiter">:(before &quot;End <a href='010vm.cc.html#L32'>instruction</a> Fields&quot;)</span>
-<span id="L264" class="LineNr">264 </span>string old_name<span class="Delimiter">;</span>
+<span id="L264" class="LineNr">264 </span>string name_before_rewrite<span class="Delimiter">;</span>
 <span id="L265" class="LineNr">265 </span><span class="Delimiter">:(before &quot;End <a href='010vm.cc.html#L32'>instruction</a> Clear&quot;)</span>
-<span id="L266" class="LineNr">266 </span>old_name<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span>
+<span id="L266" class="LineNr">266 </span>name_before_rewrite<span class="Delimiter">.</span><a href='050scenario.cc.html#L60'>clear</a><span class="Delimiter">();</span>
 <span id="L267" class="LineNr">267 </span><span class="Delimiter">:(before &quot;End next_instruction(curr)&quot;)</span>
-<span id="L268" class="LineNr">268 </span>curr<span class="Delimiter">-&gt;</span>old_name = curr<span class="Delimiter">-&gt;</span>name<span class="Delimiter">;</span>  <span class="Comment">// before rewrite rules modify it</span>
+<span id="L268" class="LineNr">268 </span>curr<span class="Delimiter">-&gt;</span>name_before_rewrite = curr<span class="Delimiter">-&gt;</span>name<span class="Delimiter">;</span>
 <span id="L269" class="LineNr">269 </span>
 <span id="L270" class="LineNr">270 </span><span class="Delimiter">:(code)</span>
 <span id="L271" class="LineNr">271 </span><span class="Comment">// is this reagent one of the values returned by the current (return) instruction?</span>
@@ -362,7 +362,7 @@ if ('onhashchange' in window) {
 <span id="L298" class="LineNr">298 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>!contains_key<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> inst<span class="Delimiter">.</span>operation<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
 <span id="L299" class="LineNr">299 </span>  <span class="Normal">const</span> recipe&amp; callee = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> inst<span class="Delimiter">.</span>operation<span class="Delimiter">);</span>
 <span id="L300" class="LineNr">300 </span>  <span class="Normal">if</span> <span class="Delimiter">(</span>callee<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
-<span id="L301" class="LineNr">301 </span>  <span class="Identifier">return</span> callee<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>old_name != <span class="Constant">&quot;local-scope&quot;</span><span class="Delimiter">;</span>  <span class="Comment">// callees that call local-scope are already dealt with before return</span>
+<span id="L301" class="LineNr">301 </span>  <span class="Identifier">return</span> callee<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name_before_rewrite != <span class="Constant">&quot;local-scope&quot;</span><span class="Delimiter">;</span>  <span class="Comment">// callees that call local-scope are already dealt with before return</span>
 <span id="L302" class="LineNr">302 </span><span class="Delimiter">}</span>
 <span id="L303" class="LineNr">303 </span>
 <span id="L304" class="LineNr">304 </span><span class="Normal">bool</span> <a href='043space.cc.html#L304'>caller_uses_product</a><span class="Delimiter">(</span><span class="Normal">int</span> product_index<span class="Delimiter">)</span> <span class="Delimiter">{</span>
diff --git a/html/062convert_ingredients_to_text.cc.html b/html/062convert_ingredients_to_text.cc.html
index 9eae6173..c97557e4 100644
--- a/html/062convert_ingredients_to_text.cc.html
+++ b/html/062convert_ingredients_to_text.cc.html
@@ -147,7 +147,7 @@ if ('onhashchange' in window) {
 <span id="L86" class="LineNr"> 86 </span>        convert_ingredient_to_text<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>j<span class="Delimiter">),</span> new_instructions<span class="Delimiter">,</span> ingredient_name<span class="Delimiter">.</span>str<span class="Delimiter">());</span>
 <span id="L87" class="LineNr"> 87 </span>      <span class="Delimiter">}</span>
 <span id="L88" class="LineNr"> 88 </span>    <span class="Delimiter">}</span>
-<span id="L89" class="LineNr"> 89 </span>    <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>old_name == <span class="Constant">&quot;append&quot;</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span id="L89" class="LineNr"> 89 </span>    <span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>name_before_rewrite == <span class="Constant">&quot;append&quot;</span><span class="Delimiter">)</span> <span class="Delimiter">{</span>
 <span id="L90" class="LineNr"> 90 </span>      <span class="Comment">// override only variants that try to append to a string</span>
 <span id="L91" class="LineNr"> 91 </span>      <span class="Comment">// Beware: this hack restricts how much 'append' can be overridden. Any</span>
 <span id="L92" class="LineNr"> 92 </span>      <span class="Comment">// new variants that match:</span>