about summary refs log tree commit diff stats
path: root/html/085scenario_console.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-06 21:49:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-06 21:49:36 -0700
commiteeed3845cd504028779c333665e0b9fad2070357 (patch)
tree3cc104aef7a43adfe4a143437f18064ad1a804d4 /html/085scenario_console.cc.html
parent924253f1a5b8cdaa3ab301d752b9bdf855d6a0f9 (diff)
downloadmu-eeed3845cd504028779c333665e0b9fad2070357.tar.gz
3456
Diffstat (limited to 'html/085scenario_console.cc.html')
-rw-r--r--html/085scenario_console.cc.html37
1 files changed, 27 insertions, 10 deletions
diff --git a/html/085scenario_console.cc.html b/html/085scenario_console.cc.html
index b51a7422..23b09fc1 100644
--- a/html/085scenario_console.cc.html
+++ b/html/085scenario_console.cc.html
@@ -49,10 +49,10 @@ recipes_taking_literal_strings<span class="Delimiter">.</span>insert<span class=
     type [abc]
   ]
   run [
-    <span class="Constant">1</span>:<span class="Normal">char</span><span class="Delimiter">,</span> console:&amp;:console<span class="Delimiter">,</span> <span class="Constant">2</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>read-key console:&amp;:console
-    <span class="Constant">3</span>:<span class="Normal">char</span><span class="Delimiter">,</span> console:&amp;:console<span class="Delimiter">,</span> <span class="Constant">4</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>read-key console:&amp;:console
-    <span class="Constant">5</span>:<span class="Normal">char</span><span class="Delimiter">,</span> console:&amp;:console<span class="Delimiter">,</span> <span class="Constant">6</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>read-key console:&amp;:console
-    <span class="Constant">7</span>:<span class="Normal">char</span><span class="Delimiter">,</span> console:&amp;:console<span class="Delimiter">,</span> <span class="Constant">8</span>:<span class="Normal">bool</span><span class="Delimiter">,</span> <span class="Constant">9</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>read-key console:&amp;:console
+    <span class="Constant">1</span>:<span class="Normal">char</span><span class="Delimiter">,</span> console<span class="Delimiter">,</span> <span class="Constant">2</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>read-key console
+    <span class="Constant">3</span>:<span class="Normal">char</span><span class="Delimiter">,</span> console<span class="Delimiter">,</span> <span class="Constant">4</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>read-key console
+    <span class="Constant">5</span>:<span class="Normal">char</span><span class="Delimiter">,</span> console<span class="Delimiter">,</span> <span class="Constant">6</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>read-key console
+    <span class="Constant">7</span>:<span class="Normal">char</span><span class="Delimiter">,</span> console<span class="Delimiter">,</span> <span class="Constant">8</span>:<span class="Normal">bool</span><span class="Delimiter">,</span> <span class="Constant">9</span>:<span class="Normal">bool</span><span class="Special"> &lt;- </span>read-key console
   ]
   memory-should-contain [
     <span class="Constant">1</span><span class="Special"> &lt;- </span><span class="Constant">97</span>  <span class="Comment"># 'a'</span>
@@ -221,6 +221,23 @@ initialize_key_names<span class="Delimiter">();</span>
   Key[<span class="Constant">&quot;escape&quot;</span>] = TB_KEY_ESC<span class="Delimiter">;</span>
 <span class="Delimiter">}</span>
 
+<span class="Delimiter">:(after &quot;Begin transform_names Ingredient Special-cases(ingredient, inst, caller)&quot;)</span>
+<span class="Normal">if</span> <span class="Delimiter">(</span>is_scenario<span class="Delimiter">(</span>caller<span class="Delimiter">))</span>
+  initialize_special_name<span class="Delimiter">(</span>ingredient<span class="Delimiter">);</span>
+<span class="Delimiter">:(after &quot;Begin transform_names Product Special-cases(product, inst, caller)&quot;)</span>
+<span class="Normal">if</span> <span class="Delimiter">(</span>is_scenario<span class="Delimiter">(</span>caller<span class="Delimiter">))</span>
+  initialize_special_name<span class="Delimiter">(</span>product<span class="Delimiter">);</span>
+<span class="Delimiter">:(code)</span>
+<span class="Normal">bool</span> is_scenario<span class="Delimiter">(</span><span class="Normal">const</span> recipe&amp; caller<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+  <span class="Identifier">return</span> starts_with<span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">,</span> <span class="Constant">&quot;scenario_&quot;</span><span class="Delimiter">);</span>
+<span class="Delimiter">}</span>
+<span class="Normal">void</span> initialize_special_name<span class="Delimiter">(</span>reagent&amp; r<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+  <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>type<span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span>
+  <span class="Comment">// no need for screen</span>
+  <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">.</span>name == <span class="Constant">&quot;console&quot;</span><span class="Delimiter">)</span> r<span class="Delimiter">.</span>type = new_type_tree<span class="Delimiter">(</span><span class="Constant">&quot;address:console&quot;</span><span class="Delimiter">);</span>
+  <span class="Comment">// End Initialize Type Of Special Name In Scenario(r)</span>
+<span class="Delimiter">}</span>
+
 <span class="Delimiter">:(scenario events_in_scenario)</span>
 <span class="muScenario">scenario</span> events-in-scenario [
   assume-console [
@@ -231,15 +248,15 @@ initialize_key_names<span class="Delimiter">();</span>
   ]
   run [
     <span class="Comment"># 3 keyboard events; each event occupies 4 locations</span>
-    <span class="Constant">1</span>:event<span class="Special"> &lt;- </span>read-event console:&amp;:console
-    <span class="Constant">5</span>:event<span class="Special"> &lt;- </span>read-event console:&amp;:console
-    <span class="Constant">9</span>:event<span class="Special"> &lt;- </span>read-event console:&amp;:console
+    <span class="Constant">1</span>:event<span class="Special"> &lt;- </span>read-event console
+    <span class="Constant">5</span>:event<span class="Special"> &lt;- </span>read-event console
+    <span class="Constant">9</span>:event<span class="Special"> &lt;- </span>read-event console
     <span class="Comment"># mouse click</span>
-    <span class="Constant">13</span>:event<span class="Special"> &lt;- </span>read-event console:&amp;:console
+    <span class="Constant">13</span>:event<span class="Special"> &lt;- </span>read-event console
     <span class="Comment"># non-character keycode</span>
-    <span class="Constant">17</span>:event<span class="Special"> &lt;- </span>read-event console:&amp;:console
+    <span class="Constant">17</span>:event<span class="Special"> &lt;- </span>read-event console
     <span class="Comment"># final keyboard event</span>
-    <span class="Constant">21</span>:event<span class="Special"> &lt;- </span>read-event console:&amp;:console
+    <span class="Constant">21</span>:event<span class="Special"> &lt;- </span>read-event console
   ]
   memory-should-contain [
     <span class="Constant">1</span><span class="Special"> &lt;- </span><span class="Constant">0</span>  <span class="Comment"># 'text'</span>