about summary refs log tree commit diff stats
path: root/html/075scenario_keyboard.cc.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/075scenario_keyboard.cc.html')
-rw-r--r--html/075scenario_keyboard.cc.html20
1 files changed, 10 insertions, 10 deletions
diff --git a/html/075scenario_keyboard.cc.html b/html/075scenario_keyboard.cc.html
index 3add7460..2a612899 100644
--- a/html/075scenario_keyboard.cc.html
+++ b/html/075scenario_keyboard.cc.html
@@ -2,7 +2,7 @@
 <html>
 <head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<title>Mu - 075scenario_keyboard.cc</title>
+<title>~/Desktop/s/mu/075scenario_keyboard.cc</title>
 <meta name="Generator" content="Vim/7.4">
 <meta name="plugin-version" content="vim7.4_v1">
 <meta name="syntax" content="cpp">
@@ -45,20 +45,20 @@ scenario keyboard-in-scenario [
   ]
   memory-should-contain [
     <span class="Constant">1</span><span class="Special"> &lt;- </span><span class="Constant">97</span>  <span class="Comment"># 'a'</span>
-    <span class="Constant">2</span><span class="Special"> &lt;- </span><span class="Constant">1</span>  <span class="Comment"># first read-key call found a character</span>
+    <span class="Constant">2</span><span class="Special"> &lt;- </span><span class="Constant">1</span>
     <span class="Constant">3</span><span class="Special"> &lt;- </span><span class="Constant">98</span>  <span class="Comment"># 'b'</span>
-    <span class="Constant">4</span><span class="Special"> &lt;- </span><span class="Constant">1</span>  <span class="Comment"># second read-key call found a character</span>
+    <span class="Constant">4</span><span class="Special"> &lt;- </span><span class="Constant">1</span>
     <span class="Constant">5</span><span class="Special"> &lt;- </span><span class="Constant">99</span>  <span class="Comment"># 'c'</span>
-    <span class="Constant">6</span><span class="Special"> &lt;- </span><span class="Constant">1</span>  <span class="Comment"># third read-key call found a character</span>
-    <span class="Constant">7</span><span class="Special"> &lt;- </span><span class="Constant">0</span>
-    <span class="Constant">8</span><span class="Special"> &lt;- </span><span class="Constant">0</span>  <span class="Comment"># fourth read-key call didn't find a character</span>
+    <span class="Constant">6</span><span class="Special"> &lt;- </span><span class="Constant">1</span>
+    <span class="Constant">7</span><span class="Special"> &lt;- </span><span class="Constant">0</span>  <span class="Comment"># eof</span>
+    <span class="Constant">8</span><span class="Special"> &lt;- </span><span class="Constant">1</span>
   ]
 ]
 
 <span class="Delimiter">:(before &quot;End Scenario Globals&quot;)</span>
 const size_t KEYBOARD = Next_predefined_global_for_scenarios++<span class="Delimiter">;</span>
 <span class="Delimiter">:(before &quot;End Predefined Scenario Locals In Run&quot;)</span>
-Name[tmp_recipe[<span class="Constant">0</span>]][<span class="Constant">&quot;keyboard&quot;</span>] = KEYBOARD<span class="Delimiter">;</span>
+Name[tmp_recipe<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span>][<span class="Constant">&quot;keyboard&quot;</span>] = KEYBOARD<span class="Delimiter">;</span>
 
 <span class="Delimiter">:(before &quot;End Rewrite Instruction(curr)&quot;)</span>
 <span class="Comment">// rewrite `assume-keyboard string` to</span>
@@ -71,17 +71,17 @@ if <span class="Delimiter">(</span>curr<span class="Delimiter">.</span>name == <
   curr<span class="Delimiter">.</span>operation = Recipe_number[<span class="Constant">&quot;new&quot;</span>]<span class="Delimiter">;</span>
   assert<span class="Delimiter">(</span>curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>empty<span class="Delimiter">());</span>
   curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span><span class="Constant">&quot;keyboard:address&quot;</span><span class="Delimiter">));</span>
-  curr<span class="Delimiter">.</span>products[<span class="Constant">0</span>]<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>KEYBOARD<span class="Delimiter">);</span>
+  curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>set_value<span class="Delimiter">(</span>KEYBOARD<span class="Delimiter">);</span>
   result<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>curr<span class="Delimiter">);</span>  <span class="Comment">// hacky that &quot;Rewrite Instruction&quot; is converting to multiple instructions</span>
   <span class="Comment">// leave second instruction in curr</span>
   curr<span class="Delimiter">.</span>clear<span class="Delimiter">();</span>
   curr<span class="Delimiter">.</span>operation = Recipe_number[<span class="Constant">&quot;init-fake-keyboard&quot;</span>]<span class="Delimiter">;</span>
   assert<span class="Delimiter">(</span>curr<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>empty<span class="Delimiter">());</span>
   curr<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span><span class="Constant">&quot;keyboard:address&quot;</span><span class="Delimiter">));</span>
-  curr<span class="Delimiter">.</span>ingredients[<span class="Constant">0</span>]<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>KEYBOARD<span class="Delimiter">);</span>
+  curr<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>set_value<span class="Delimiter">(</span>KEYBOARD<span class="Delimiter">);</span>
   assert<span class="Delimiter">(</span>curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>empty<span class="Delimiter">());</span>
   curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span><span class="Constant">&quot;keyboard:address&quot;</span><span class="Delimiter">));</span>
-  curr<span class="Delimiter">.</span>products[<span class="Constant">0</span>]<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>KEYBOARD<span class="Delimiter">);</span>
+  curr<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>set_value<span class="Delimiter">(</span>KEYBOARD<span class="Delimiter">);</span>
 <span class="Delimiter">}</span>
 </pre>
 </body>
m <vc@akkartik.com> 2020-05-22 23:08:09 -0700 committer Kartik Agaram <vc@akkartik.com> 2020-05-22 23:12:11 -0700 6384' href='/akkartik/mu/commit/html/055stream.subx.html?h=hlt&id=9a77780158842db6e4aa098f5027e030fc3bd878'>9a777801 ^
6e181e7f ^
3350c34a ^


































































6e181e7f ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140