diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-23 19:45:36 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-23 19:56:28 -0700 |
commit | f918675c8b11adb80a83000a3a984e4ff3bdcf1b (patch) | |
tree | 2472316e3bf536e0bad76751c5f3504d029b8215 /html/084console.mu.html | |
parent | af7349d50c40e0604c9bb1e9a50aa1c3c0d407d8 (diff) | |
download | mu-f918675c8b11adb80a83000a3a984e4ff3bdcf1b.tar.gz |
3569
Update syntax highlighting to not color numeric locations like literals.
Diffstat (limited to 'html/084console.mu.html')
-rw-r--r-- | html/084console.mu.html | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/html/084console.mu.html b/html/084console.mu.html index 42938cfe..9271231a 100644 --- a/html/084console.mu.html +++ b/html/084console.mu.html @@ -61,8 +61,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muRecipe">def</span> new-fake-console events:&:@:event<span class="muRecipe"> -> </span>result:&:console [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - result:&:console<span class="Special"> <- </span>new <span class="Constant">console:type</span> - *result<span class="Special"> <- </span>put *result, <span class="Constant">events:offset</span>, events + result:&:console <span class="Special"><-</span> new <span class="Constant">console:type</span> + *result <span class="Special"><-</span> put *result, <span class="Constant">events:offset</span>, events ] <span class="muRecipe">def</span> read-event console:&:console<span class="muRecipe"> -> </span>result:event, found?:bool, quit?:bool, console:&:console [ @@ -70,22 +70,22 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">load-ingredients</span> <span class="Delimiter">{</span> <span class="muControl">break-unless</span> console - current-event-index:num<span class="Special"> <- </span>get *console, <span class="Constant">current-event-index:offset</span> - buf:&:@:event<span class="Special"> <- </span>get *console, <span class="Constant">events:offset</span> + current-event-index:num <span class="Special"><-</span> get *console, <span class="Constant">current-event-index:offset</span> + buf:&:@:event <span class="Special"><-</span> get *console, <span class="Constant">events:offset</span> <span class="Delimiter">{</span> - max:num<span class="Special"> <- </span>length *buf - done?:bool<span class="Special"> <- </span>greater-or-equal current-event-index, max + max:num <span class="Special"><-</span> length *buf + done?:bool <span class="Special"><-</span> greater-or-equal current-event-index, max <span class="muControl">break-unless</span> done? - dummy:&:event<span class="Special"> <- </span>new <span class="Constant">event:type</span> + dummy:&:event <span class="Special"><-</span> new <span class="Constant">event:type</span> <span class="muControl">return</span> *dummy, <span class="Constant">1/found</span>, <span class="Constant">1/quit</span> <span class="Delimiter">}</span> - result<span class="Special"> <- </span>index *buf, current-event-index - current-event-index<span class="Special"> <- </span>add current-event-index, <span class="Constant">1</span> - *console<span class="Special"> <- </span>put *console, <span class="Constant">current-event-index:offset</span>, current-event-index + result <span class="Special"><-</span> index *buf, current-event-index + current-event-index <span class="Special"><-</span> add current-event-index,<span class="Constant"> 1</span> + *console <span class="Special"><-</span> put *console, <span class="Constant">current-event-index:offset</span>, current-event-index <span class="muControl">return</span> result, <span class="Constant">1/found</span>, <span class="Constant">0/quit</span> <span class="Delimiter">}</span> switch <span class="Comment"># real event source is infrequent; avoid polling it too much</span> - result:event, found?:bool<span class="Special"> <- </span>check-for-interaction + result:event, found?:bool <span class="Special"><-</span> check-for-interaction <span class="muControl">return</span> result, found?, <span class="Constant">0/quit</span> ] @@ -95,11 +95,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muRecipe">def</span> read-key console:&:console<span class="muRecipe"> -> </span>result:char, found?:bool, quit?:bool, console:&:console [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - x:event, found?:bool, quit?:bool, console<span class="Special"> <- </span>read-event console - <span class="muControl">return-if</span> quit?, <span class="Constant">0</span>, found?, quit? - <span class="muControl">return-unless</span> found?, <span class="Constant">0</span>, found?, quit? - c:char, converted?:bool<span class="Special"> <- </span>maybe-convert x, <span class="Constant">text:variant</span> - <span class="muControl">return-unless</span> converted?, <span class="Constant">0</span>, <span class="Constant">0/found</span>, <span class="Constant">0/quit</span> + x:event, found?:bool, quit?:bool, console <span class="Special"><-</span> read-event console + <span class="muControl">return-if</span> quit?,<span class="Constant"> 0</span>, found?, quit? + <span class="muControl">return-unless</span> found?,<span class="Constant"> 0</span>, found?, quit? + c:char, converted?:bool <span class="Special"><-</span> maybe-convert x, <span class="Constant">text:variant</span> + <span class="muControl">return-unless</span> converted?,<span class="Constant"> 0</span>, <span class="Constant">0/found</span>, <span class="Constant">0/quit</span> <span class="muControl">return</span> c, <span class="Constant">1/found</span>, <span class="Constant">0/quit</span> ] @@ -107,22 +107,22 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Delimiter">{</span> - c:char, found?:bool, quit?:bool, console<span class="Special"> <- </span>read-key console + c:char, found?:bool, quit?:bool, console <span class="Special"><-</span> read-key console <span class="muControl">loop-unless</span> found? <span class="muControl">break-if</span> quit? assert c, <span class="Constant">[invalid event, expected text]</span> - screen<span class="Special"> <- </span>print screen, c - chan<span class="Special"> <- </span>write chan, c + screen <span class="Special"><-</span> print screen, c + chan <span class="Special"><-</span> write chan, c <span class="muControl">loop</span> <span class="Delimiter">}</span> - chan<span class="Special"> <- </span>close chan + chan <span class="Special"><-</span> close chan ] <span class="muRecipe">def</span> wait-for-event console:&:console<span class="muRecipe"> -> </span>console:&:console [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Delimiter">{</span> - _, found?:bool<span class="Special"> <- </span>read-event console + _, found?:bool <span class="Special"><-</span> read-event console <span class="muControl">loop-unless</span> found? <span class="Delimiter">}</span> ] @@ -136,7 +136,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># fake consoles should be plenty fast; never skip</span> <span class="muControl">return</span> <span class="Constant">0/false</span> <span class="Delimiter">}</span> - result<span class="Special"> <- </span>interactions-left? + result <span class="Special"><-</span> interactions-left? ] </pre> </body> |