3568
Fix syntax highlighting for labels after commit 3552.
This commit is contained in:
parent
09788d7edf
commit
af7349d50c
|
@ -178,7 +178,7 @@ string next_word(istream& in) {
|
|||
|
||||
bool is_label_word(const string& word) {
|
||||
assert(!word.empty());
|
||||
return !isalnum(word.at(0)) && string("$_-").find(word.at(0)) == string::npos;
|
||||
return !isalnum(word.at(0)) && string("$_*@&,=-").find(word.at(0)) == string::npos;
|
||||
}
|
||||
|
||||
bool ends_with(const string& s, const char c) {
|
||||
|
|
|
@ -214,7 +214,7 @@ string next_word<span class="Delimiter">(</span>istream& in<span class="Deli
|
|||
|
||||
<span class="Normal">bool</span> is_label_word<span class="Delimiter">(</span><span class="Normal">const</span> string& word<span class="Delimiter">)</span> <span class="Delimiter">{</span>
|
||||
assert<span class="Delimiter">(</span>!word<span class="Delimiter">.</span>empty<span class="Delimiter">());</span>
|
||||
<span class="Identifier">return</span> !isalnum<span class="Delimiter">(</span>word<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> && string<span class="Delimiter">(</span><span class="Constant">"$_-"</span><span class="Delimiter">).</span>find<span class="Delimiter">(</span>word<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> == string::npos<span class="Delimiter">;</span>
|
||||
<span class="Identifier">return</span> !isalnum<span class="Delimiter">(</span>word<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> && string<span class="Delimiter">(</span><span class="Constant">"$_*@&,=-"</span><span class="Delimiter">).</span>find<span class="Delimiter">(</span>word<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> == string::npos<span class="Delimiter">;</span>
|
||||
<span class="Delimiter">}</span>
|
||||
|
||||
<span class="Normal">bool</span> ends_with<span class="Delimiter">(</span><span class="Normal">const</span> string& s<span class="Delimiter">,</span> <span class="Normal">const</span> <span class="Normal">char</span> c<span class="Delimiter">)</span> <span class="Delimiter">{</span>
|
||||
|
|
|
@ -540,7 +540,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="Delimiter">{</span>
|
||||
<span class="Comment"># while i < template.length</span>
|
||||
tem-done?:bool<span class="Special"> <- </span>greater-or-equal i, tem-len
|
||||
<span class="muControl">break-if</span> tem-done?, +done
|
||||
<span class="muControl">break-if</span> tem-done?, <span class="Constant">+done</span>
|
||||
<span class="Comment"># while template[i] != '_'</span>
|
||||
in:char<span class="Special"> <- </span>index *template, i
|
||||
underscore?:bool<span class="Special"> <- </span>equal in, <span class="Constant">95/_</span>
|
||||
|
|
|
@ -440,7 +440,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
*line<span class="Special"> <- </span>put *line, <span class="Constant">length:offset</span>, buffer-length
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># and don't append this one</span>
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># append anything else</span>
|
||||
line<span class="Special"> <- </span>append line, c
|
||||
|
|
|
@ -126,7 +126,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
cursor-to-next-line screen
|
||||
screen<span class="Special"> <- </span>print screen, <span class="Constant">[move: ]</span>
|
||||
m:&:move, quit:bool, error:bool<span class="Special"> <- </span>read-move buffered-stdin-in, screen
|
||||
<span class="muControl">break-if</span> quit, +quit
|
||||
<span class="muControl">break-if</span> quit, <span class="Constant">+quit</span>
|
||||
buffered-stdin-in<span class="Special"> <- </span>clear buffered-stdin-in <span class="Comment"># cleanup after error. todo: test this?</span>
|
||||
<span class="muControl">loop-if</span> error
|
||||
<span class="Delimiter">}</span>
|
||||
|
|
|
@ -215,7 +215,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>move-cursor screen, row, column
|
||||
curr<span class="Special"> <- </span>next curr
|
||||
prev<span class="Special"> <- </span>next prev
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">{</span>
|
||||
<span class="Comment"># at right? wrap. even if there's only one more letter left; we need</span>
|
||||
|
@ -229,7 +229,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
row<span class="Special"> <- </span>add row, <span class="Constant">1</span>
|
||||
screen<span class="Special"> <- </span>move-cursor screen, row, column
|
||||
<span class="Comment"># don't increment curr</span>
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
print screen, c, color
|
||||
curr<span class="Special"> <- </span>next curr
|
||||
|
@ -449,7 +449,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="muControl">break-unless</span> starting-comment?
|
||||
trace <span class="Constant">90</span>, <span class="Constant">[app]</span>, <span class="Constant">[switch color back to blue]</span>
|
||||
color<span class="Special"> <- </span>copy <span class="Constant">12/lightblue</span>
|
||||
<span class="muControl">jump</span> +exit
|
||||
<span class="muControl">jump</span> <span class="Constant">+exit</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># if color is blue and next character is newline, switch color to white</span>
|
||||
<span class="Delimiter">{</span>
|
||||
|
@ -459,7 +459,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="muControl">break-unless</span> ending-comment?
|
||||
trace <span class="Constant">90</span>, <span class="Constant">[app]</span>, <span class="Constant">[switch color back to white]</span>
|
||||
color<span class="Special"> <- </span>copy <span class="Constant">7/white</span>
|
||||
<span class="muControl">jump</span> +exit
|
||||
<span class="muControl">jump</span> <span class="Constant">+exit</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># if color is white (no comments) and next character is '<', switch color to red</span>
|
||||
<span class="Delimiter">{</span>
|
||||
|
@ -467,7 +467,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
starting-assignment?:bool<span class="Special"> <- </span>equal c, <span class="Constant">60/<</span>
|
||||
<span class="muControl">break-unless</span> starting-assignment?
|
||||
color<span class="Special"> <- </span>copy <span class="Constant">1/red</span>
|
||||
<span class="muControl">jump</span> +exit
|
||||
<span class="muControl">jump</span> <span class="Constant">+exit</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># if color is red and next character is space, switch color to white</span>
|
||||
<span class="Delimiter">{</span>
|
||||
|
@ -476,7 +476,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
ending-assignment?:bool<span class="Special"> <- </span>equal c, <span class="Constant">32/space</span>
|
||||
<span class="muControl">break-unless</span> ending-assignment?
|
||||
color<span class="Special"> <- </span>copy <span class="Constant">7/white</span>
|
||||
<span class="muControl">jump</span> +exit
|
||||
<span class="muControl">jump</span> <span class="Constant">+exit</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># otherwise no change</span>
|
||||
<span class="Constant"> +exit</span>
|
||||
|
|
|
@ -64,7 +64,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="Delimiter">{</span>
|
||||
<span class="muControl">break-unless</span> is-touch?
|
||||
move-cursor-in-editor screen, editor, t
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># keyboard events</span>
|
||||
<span class="Delimiter">{</span>
|
||||
|
@ -160,7 +160,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
column<span class="Special"> <- </span>copy left
|
||||
curr<span class="Special"> <- </span>next curr
|
||||
prev<span class="Special"> <- </span>next prev
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">{</span>
|
||||
<span class="Comment"># at right? wrap. even if there's only one more letter left; we need</span>
|
||||
|
@ -170,7 +170,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
column<span class="Special"> <- </span>copy left
|
||||
row<span class="Special"> <- </span>add row, <span class="Constant">1</span>
|
||||
<span class="Comment"># don't increment curr/prev</span>
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
curr<span class="Special"> <- </span>next curr
|
||||
prev<span class="Special"> <- </span>next prev
|
||||
|
|
|
@ -1276,7 +1276,7 @@ d]
|
|||
no-motion?:bool<span class="Special"> <- </span>equal next-line, before-cursor
|
||||
<span class="muControl">break-unless</span> no-motion?
|
||||
scroll?:bool<span class="Special"> <- </span>greater-than cursor-row, <span class="Constant">1</span>
|
||||
<span class="muControl">break-if</span> scroll?, +try-to-scroll
|
||||
<span class="muControl">break-if</span> scroll?, <span class="Constant">+try-to-scroll</span>
|
||||
go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span>
|
||||
<span class="muControl">return</span>
|
||||
<span class="Delimiter">}</span>
|
||||
|
|
|
@ -120,7 +120,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="Comment"># todo: test this</span>
|
||||
touch-type:num<span class="Special"> <- </span>get t, <span class="Constant">type:offset</span>
|
||||
is-left-click?:bool<span class="Special"> <- </span>equal touch-type, <span class="Constant">65513/mouse-left</span>
|
||||
<span class="muControl">loop-unless</span> is-left-click?, +next-event
|
||||
<span class="muControl">loop-unless</span> is-left-click?, <span class="Constant">+next-event</span>
|
||||
click-row:num<span class="Special"> <- </span>get t, <span class="Constant">row:offset</span>
|
||||
click-column:num<span class="Special"> <- </span>get t, <span class="Constant">column:offset</span>
|
||||
<span class="Comment"># later exceptions for non-editor touches will go here</span>
|
||||
|
@ -130,7 +130,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
sandbox-in-focus?:bool<span class="Special"> <- </span>move-cursor-in-editor screen, current-sandbox, t
|
||||
*env<span class="Special"> <- </span>put *env, <span class="Constant">sandbox-in-focus?:offset</span>, sandbox-in-focus?
|
||||
screen<span class="Special"> <- </span>update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># 'resize' event - redraw editor</span>
|
||||
<span class="Comment"># todo: test this after supporting resize in assume-console</span>
|
||||
|
@ -149,7 +149,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>render-all screen, env, render-without-moving-cursor
|
||||
render-all-on-no-more-events?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> <span class="Comment"># full render done</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># if it's not global and not a touch event, send to appropriate editor</span>
|
||||
<span class="Delimiter">{</span>
|
||||
|
@ -164,7 +164,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="Delimiter">{</span>
|
||||
<span class="muControl">break-unless</span> more-events?
|
||||
render-all-on-no-more-events?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> <span class="Comment"># no rendering now, full rendering on some future event</span>
|
||||
<span class="muControl">jump</span> +finish-event
|
||||
<span class="muControl">jump</span> <span class="Constant">+finish-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">{</span>
|
||||
<span class="muControl">break-if</span> more-events?
|
||||
|
@ -173,13 +173,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="Comment"># no more events, and we have to force render</span>
|
||||
screen<span class="Special"> <- </span>render-all screen, env, render
|
||||
render-all-on-no-more-events?<span class="Special"> <- </span>copy <span class="Constant">0/false</span>
|
||||
<span class="muControl">jump</span> +finish-event
|
||||
<span class="muControl">jump</span> <span class="Constant">+finish-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># no more events, no force render</span>
|
||||
<span class="Delimiter">{</span>
|
||||
<span class="muControl">break-unless</span> render?
|
||||
screen<span class="Special"> <- </span>render-recipes screen, env, render
|
||||
<span class="muControl">jump</span> +finish-event
|
||||
<span class="muControl">jump</span> <span class="Constant">+finish-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">}</span>
|
||||
|
@ -192,7 +192,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="Delimiter">{</span>
|
||||
<span class="muControl">break-unless</span> more-events?
|
||||
render-all-on-no-more-events?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> <span class="Comment"># no rendering now, full rendering on some future event</span>
|
||||
<span class="muControl">jump</span> +finish-event
|
||||
<span class="muControl">jump</span> <span class="Constant">+finish-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">{</span>
|
||||
<span class="muControl">break-if</span> more-events?
|
||||
|
@ -201,13 +201,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="Comment"># no more events, and we have to force render</span>
|
||||
screen<span class="Special"> <- </span>render-all screen, env, render
|
||||
render-all-on-no-more-events?<span class="Special"> <- </span>copy <span class="Constant">0/false</span>
|
||||
<span class="muControl">jump</span> +finish-event
|
||||
<span class="muControl">jump</span> <span class="Constant">+finish-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># no more events, no force render</span>
|
||||
<span class="Delimiter">{</span>
|
||||
<span class="muControl">break-unless</span> render?
|
||||
screen<span class="Special"> <- </span>render-sandbox-side screen, env, render
|
||||
<span class="muControl">jump</span> +finish-event
|
||||
<span class="muControl">jump</span> <span class="Constant">+finish-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">}</span>
|
||||
|
@ -298,7 +298,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>move-cursor screen, row, column
|
||||
curr<span class="Special"> <- </span>next curr
|
||||
prev<span class="Special"> <- </span>next prev
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">{</span>
|
||||
<span class="Comment"># at right? wrap. even if there's only one more letter left; we need</span>
|
||||
|
@ -312,7 +312,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
row<span class="Special"> <- </span>add row, <span class="Constant">1</span>
|
||||
screen<span class="Special"> <- </span>move-cursor screen, row, column
|
||||
<span class="Comment"># don't increment curr</span>
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
print screen, c, color
|
||||
curr<span class="Special"> <- </span>next curr
|
||||
|
@ -599,7 +599,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
column<span class="Special"> <- </span>copy left
|
||||
row<span class="Special"> <- </span>add row, <span class="Constant">1</span>
|
||||
screen<span class="Special"> <- </span>move-cursor screen, row, column
|
||||
<span class="muControl">loop</span> +next-character <span class="Comment"># retry i</span>
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span> <span class="Comment"># retry i</span>
|
||||
<span class="Delimiter">}</span>
|
||||
i<span class="Special"> <- </span>add i, <span class="Constant">1</span>
|
||||
<span class="Delimiter">{</span>
|
||||
|
@ -618,7 +618,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
row<span class="Special"> <- </span>add row, <span class="Constant">1</span>
|
||||
column<span class="Special"> <- </span>copy left
|
||||
screen<span class="Special"> <- </span>move-cursor screen, row, column
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
print screen, c, color
|
||||
column<span class="Special"> <- </span>add column, <span class="Constant">1</span>
|
||||
|
@ -641,7 +641,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="muControl">break-unless</span> redraw-screen?
|
||||
screen<span class="Special"> <- </span>render-all screen, env:&:environment, render
|
||||
sync-screen screen
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
@ -656,7 +656,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
sandbox-in-focus?<span class="Special"> <- </span>not sandbox-in-focus?
|
||||
*env<span class="Special"> <- </span>put *env, <span class="Constant">sandbox-in-focus?:offset</span>, sandbox-in-focus?
|
||||
screen<span class="Special"> <- </span>update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>update-status screen, <span class="Constant">[ ]</span>, <span class="Constant">245/grey</span>
|
||||
<span class="Delimiter">}</span>
|
||||
screen<span class="Special"> <- </span>update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
@ -253,7 +253,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="Constant">load-ingredients</span>
|
||||
current-sandbox:&:editor<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span>
|
||||
<span class="Comment"># first clear previous versions, in case we deleted some sandbox</span>
|
||||
$system <span class="Constant">[rm lesson/[0-9]</span>* >/dev/null <span class="Constant">2</span>>/dev/null] <span class="Comment"># some shells can't handle '>&'</span>
|
||||
$system <span class="Constant">[rm lesson/[0-9]</span>* <span class="Constant">>/dev/null</span> <span class="Constant">2</span>>/dev/null] <span class="Comment"># some shells can't handle '>&'</span>
|
||||
curr:&:sandbox<span class="Special"> <- </span>get *env, <span class="Constant">sandbox:offset</span>
|
||||
idx:num<span class="Special"> <- </span>copy <span class="Constant">0</span>
|
||||
<span class="Delimiter">{</span>
|
||||
|
@ -415,7 +415,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
column<span class="Special"> <- </span>copy left
|
||||
row<span class="Special"> <- </span>add row, <span class="Constant">1</span>
|
||||
screen<span class="Special"> <- </span>move-cursor screen, row, column
|
||||
<span class="muControl">loop</span> +next-character <span class="Comment"># retry i</span>
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span> <span class="Comment"># retry i</span>
|
||||
<span class="Delimiter">}</span>
|
||||
i<span class="Special"> <- </span>add i, <span class="Constant">1</span>
|
||||
<span class="Delimiter">{</span>
|
||||
|
@ -434,7 +434,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
row<span class="Special"> <- </span>add row, <span class="Constant">1</span>
|
||||
column<span class="Special"> <- </span>copy left
|
||||
screen<span class="Special"> <- </span>move-cursor screen, row, column
|
||||
<span class="muControl">loop</span> +next-character
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-character</span>
|
||||
<span class="Delimiter">}</span>
|
||||
print screen, c, color
|
||||
column<span class="Special"> <- </span>add column, <span class="Constant">1</span>
|
||||
|
@ -741,7 +741,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="muControl">break-unless</span> at-bottom-of-editor?
|
||||
more-to-scroll?:bool<span class="Special"> <- </span>more-to-scroll? env, screen
|
||||
<span class="muControl">break-if</span> more-to-scroll?
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Delimiter">{</span>
|
||||
<span class="muControl">break-if</span> sandbox-in-focus?
|
||||
|
@ -749,7 +749,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="muControl">break-unless</span> page-down?
|
||||
more-to-scroll?:bool<span class="Special"> <- </span>more-to-scroll? env, screen
|
||||
<span class="muControl">break-if</span> more-to-scroll?
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
@ -760,7 +760,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="muControl">break-unless</span> page-down?
|
||||
more-to-scroll?:bool<span class="Special"> <- </span>more-to-scroll? env, screen
|
||||
<span class="muControl">break-if</span> more-to-scroll?
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
@ -898,14 +898,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
number-of-sandboxes:num<span class="Special"> <- </span>get *env, <span class="Constant">number-of-sandboxes:offset</span>
|
||||
max:num<span class="Special"> <- </span>subtract number-of-sandboxes, <span class="Constant">1</span>
|
||||
at-end?:bool<span class="Special"> <- </span>greater-or-equal render-from, max
|
||||
<span class="muControl">jump-if</span> at-end?, +finish-event <span class="Comment"># render nothing</span>
|
||||
<span class="muControl">jump-if</span> at-end?, <span class="Constant">+finish-event</span> <span class="Comment"># render nothing</span>
|
||||
render-from<span class="Special"> <- </span>add render-from, <span class="Constant">1</span>
|
||||
*env<span class="Special"> <- </span>put *env, <span class="Constant">render-from:offset</span>, render-from
|
||||
<span class="Delimiter">}</span>
|
||||
hide-screen screen
|
||||
screen<span class="Special"> <- </span>render-sandbox-side screen, env, render
|
||||
show-screen screen
|
||||
<span class="muControl">jump</span> +finish-event
|
||||
<span class="muControl">jump</span> <span class="Constant">+finish-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
@ -936,7 +936,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
hide-screen screen
|
||||
screen<span class="Special"> <- </span>render-sandbox-side screen, env, render
|
||||
show-screen screen
|
||||
<span class="muControl">jump</span> +finish-event
|
||||
<span class="muControl">jump</span> <span class="Constant">+finish-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>render-sandbox-side screen, env, render
|
||||
screen<span class="Special"> <- </span>update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
|
||||
show-screen screen
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>render-sandbox-side screen, env, render
|
||||
screen<span class="Special"> <- </span>update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
|
||||
show-screen screen
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>render-sandbox-side screen, env, render
|
||||
screen<span class="Special"> <- </span>update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
|
||||
show-screen screen
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
|
||||
<span class="Comment"># no change in cursor</span>
|
||||
show-screen screen
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
@ -232,7 +232,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
<span class="muControl">break-unless</span> response-is-expected?:bool
|
||||
row, screen<span class="Special"> <- </span>render-text screen, sandbox-response, left, right, <span class="Constant">2/green</span>, row
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="muControl">jump</span> +render-sandbox-end
|
||||
<span class="muControl">jump</span> <span class="Constant">+render-sandbox-end</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
screen<span class="Special"> <- </span>update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
|
||||
<span class="Comment"># no change in cursor</span>
|
||||
show-screen screen
|
||||
<span class="muControl">loop</span> +next-event
|
||||
<span class="muControl">loop</span> <span class="Constant">+next-event</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
*sandbox<span class="Special"> <- </span>put *sandbox, <span class="Constant">response-starting-row-on-screen:offset</span>, <span class="Constant">0</span> <span class="Comment"># no response</span>
|
||||
row, screen<span class="Special"> <- </span>render-text screen, sandbox-errors, left, right, <span class="Constant">1/red</span>, row
|
||||
<span class="Comment"># don't try to print anything more for this sandbox</span>
|
||||
<span class="muControl">jump</span> +render-sandbox-end
|
||||
<span class="muControl">jump</span> <span class="Constant">+render-sandbox-end</span>
|
||||
<span class="Delimiter">}</span>
|
||||
]
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
typing<span class="Special"> <- </span>put typing, <span class="Constant">after-column:offset</span>, cursor-column
|
||||
typing<span class="Special"> <- </span>put typing, <span class="Constant">after-top-of-screen:offset</span>, top-after
|
||||
*op<span class="Special"> <- </span>merge <span class="Constant">0/insert-operation</span>, typing
|
||||
<span class="muControl">break</span> +done-adding-insert-operation
|
||||
<span class="muControl">break</span> <span class="Constant">+done-adding-insert-operation</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># if not, create a new operation</span>
|
||||
insert-from:&:duplex-list:char<span class="Special"> <- </span>next cursor-before
|
||||
|
@ -777,7 +777,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
move<span class="Special"> <- </span>put move, <span class="Constant">after-column:offset</span>, cursor-column
|
||||
move<span class="Special"> <- </span>put move, <span class="Constant">after-top-of-screen:offset</span>, top-after
|
||||
*op<span class="Special"> <- </span>merge <span class="Constant">1/move-operation</span>, move
|
||||
<span class="muControl">break</span> +done-adding-move-operation
|
||||
<span class="muControl">break</span> <span class="Constant">+done-adding-move-operation</span>
|
||||
<span class="Delimiter">}</span>
|
||||
op:&:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span>
|
||||
*op<span class="Special"> <- </span>merge <span class="Constant">1/move-operation</span>, cursor-row-before, cursor-column-before, top-before, cursor-row/after, cursor-column/after, top-after, undo-coalesce-tag
|
||||
|
@ -1678,7 +1678,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
deletion<span class="Special"> <- </span>put deletion, <span class="Constant">after-column:offset</span>, cursor-column
|
||||
deletion<span class="Special"> <- </span>put deletion, <span class="Constant">after-top-of-screen:offset</span>, top-after
|
||||
*op<span class="Special"> <- </span>merge <span class="Constant">2/delete-operation</span>, deletion
|
||||
<span class="muControl">break</span> +done-adding-backspace-operation
|
||||
<span class="muControl">break</span> <span class="Constant">+done-adding-backspace-operation</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># if not, create a new operation</span>
|
||||
op:&:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span>
|
||||
|
@ -1905,7 +1905,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
deletion<span class="Special"> <- </span>put deletion, <span class="Constant">after-column:offset</span>, cursor-column
|
||||
deletion<span class="Special"> <- </span>put deletion, <span class="Constant">after-top-of-screen:offset</span>, top-after
|
||||
*op<span class="Special"> <- </span>merge <span class="Constant">2/delete-operation</span>, deletion
|
||||
<span class="muControl">break</span> +done-adding-delete-operation
|
||||
<span class="muControl">break</span> <span class="Constant">+done-adding-delete-operation</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># if not, create a new operation</span>
|
||||
op:&:operation<span class="Special"> <- </span>new <span class="Constant">operation:type</span>
|
||||
|
|
|
@ -268,7 +268,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
close-paren?:bool<span class="Special"> <- </span>equal c, <span class="Constant">41/close-paren</span>
|
||||
<span class="muControl">break-unless</span> close-paren?
|
||||
read in <span class="Comment"># skip ')'</span>
|
||||
<span class="muControl">break</span> +end-pair
|
||||
<span class="muControl">break</span> <span class="Constant">+end-pair</span>
|
||||
<span class="Delimiter">}</span>
|
||||
<span class="Comment"># still here? read next element of pair</span>
|
||||
next:&:cell, in<span class="Special"> <- </span>parse in
|
||||
|
@ -378,7 +378,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
s:text<span class="Special"> <- </span>new <span class="Constant">[(abc def)]</span>
|
||||
x:&:cell<span class="Special"> <- </span>parse s
|
||||
trace-should-contain [
|
||||
app/parse: < abc | < def | <span class="Constant"><></span> > >
|
||||
app/parse: <span class="Constant"><</span> abc <span class="Constant">|</span> <span class="Constant"><</span> def <span class="Constant">|</span> <span class="Constant"><></span> <span class="Constant">></span> <span class="Constant">></span>
|
||||
]
|
||||
<span class="Constant">10</span>:bool/<span class="Special">raw <- </span>is-pair? x
|
||||
x1:&:cell<span class="Special"> <- </span>first x
|
||||
|
@ -406,7 +406,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
s:text<span class="Special"> <- </span>new <span class="Constant">[ ( abc def ) ]</span> <span class="Comment"># extra spaces</span>
|
||||
x:&:cell<span class="Special"> <- </span>parse s
|
||||
trace-should-contain [
|
||||
app/parse: < abc | < def | <span class="Constant"><></span> > >
|
||||
app/parse: <span class="Constant"><</span> abc <span class="Constant">|</span> <span class="Constant"><</span> def <span class="Constant">|</span> <span class="Constant"><></span> <span class="Constant">></span> <span class="Constant">></span>
|
||||
]
|
||||
<span class="Constant">10</span>:bool/<span class="Special">raw <- </span>is-pair? x
|
||||
x1:&:cell<span class="Special"> <- </span>first x
|
||||
|
@ -434,7 +434,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
s:text<span class="Special"> <- </span>new <span class="Constant">[(abc def ghi)]</span>
|
||||
x:&:cell<span class="Special"> <- </span>parse s
|
||||
trace-should-contain [
|
||||
app/parse: < abc | < def | < ghi | <span class="Constant"><></span> > > >
|
||||
app/parse: <span class="Constant"><</span> abc <span class="Constant">|</span> <span class="Constant"><</span> def <span class="Constant">|</span> <span class="Constant"><</span> ghi <span class="Constant">|</span> <span class="Constant"><></span> <span class="Constant">></span> <span class="Constant">></span> <span class="Constant">></span>
|
||||
]
|
||||
<span class="Constant">10</span>:bool/<span class="Special">raw <- </span>is-pair? x
|
||||
x1:&:cell<span class="Special"> <- </span>first x
|
||||
|
@ -470,7 +470,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
s:text<span class="Special"> <- </span>new <span class="Constant">[((abc))]</span>
|
||||
x:&:cell<span class="Special"> <- </span>parse s
|
||||
trace-should-contain [
|
||||
app/parse: < < abc | <span class="Constant"><></span> > | <span class="Constant"><></span> >
|
||||
app/parse: <span class="Constant"><</span> <span class="Constant"><</span> abc <span class="Constant">|</span> <span class="Constant"><></span> <span class="Constant">></span> <span class="Constant">|</span> <span class="Constant"><></span> <span class="Constant">></span>
|
||||
]
|
||||
<span class="Constant">10</span>:bool/<span class="Special">raw <- </span>is-pair? x
|
||||
x1:&:cell<span class="Special"> <- </span>first x
|
||||
|
@ -495,7 +495,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
s:text<span class="Special"> <- </span>new <span class="Constant">[((abc) def)]</span>
|
||||
x:&:cell<span class="Special"> <- </span>parse s
|
||||
trace-should-contain [
|
||||
app/parse: < < abc | <span class="Constant"><></span> > | < def | <span class="Constant"><></span> > >
|
||||
app/parse: <span class="Constant"><</span> <span class="Constant"><</span> abc <span class="Constant">|</span> <span class="Constant"><></span> <span class="Constant">></span> <span class="Constant">|</span> <span class="Constant"><</span> def <span class="Constant">|</span> <span class="Constant"><></span> <span class="Constant">></span> <span class="Constant">></span>
|
||||
]
|
||||
<span class="Constant">10</span>:bool/<span class="Special">raw <- </span>is-pair? x
|
||||
x1:&:cell<span class="Special"> <- </span>first x
|
||||
|
@ -550,7 +550,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
s:text<span class="Special"> <- </span>new <span class="Constant">[(abc . def)]</span>
|
||||
x:&:cell<span class="Special"> <- </span>parse s
|
||||
trace-should-contain [
|
||||
app/parse: < abc | def >
|
||||
app/parse: <span class="Constant"><</span> abc <span class="Constant">|</span> def <span class="Constant">></span>
|
||||
]
|
||||
<span class="Constant">10</span>:bool/<span class="Special">raw <- </span>is-pair? x
|
||||
x1:&:cell<span class="Special"> <- </span>first x
|
||||
|
@ -574,7 +574,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
|
|||
s:text<span class="Special"> <- </span>new <span class="Constant">[(abc def . ghi)]</span>
|
||||
x:&:cell<span class="Special"> <- </span>parse s
|
||||
trace-should-contain [
|
||||
app/parse: < abc | < def | ghi > >
|
||||
app/parse: <span class="Constant"><</span> abc <span class="Constant">|</span> <span class="Constant"><</span> def <span class="Constant">|</span> ghi <span class="Constant">></span> <span class="Constant">></span>
|
||||
]
|
||||
<span class="Constant">10</span>:bool/<span class="Special">raw <- </span>is-pair? x
|
||||
x1:&:cell<span class="Special"> <- </span>first x
|
||||
|
|
4
mu.vim
4
mu.vim
|
@ -33,6 +33,7 @@ let b:cmt_head = "#? "
|
|||
|
||||
" Mu strings are inside [ ... ] and can span multiple lines
|
||||
" don't match '[' at end of line, that's usually code
|
||||
syntax match muLiteral %^[^ a-zA-Z0-9(){}\[\]#$_*@&,=-][^ ,]*\|[ ,]\@<=[^ a-zA-Z0-9(){}\[\]#$_*@&,=-][^ ,]*%
|
||||
syntax region muString start=+\[[^\]]+ end=+\]+
|
||||
syntax match muString "\[\]"
|
||||
highlight link muString String
|
||||
|
@ -45,8 +46,9 @@ syntax match muLiteral %[^ ]\+:literal/[^ ,]*\|[^ ]\+:literal\>%
|
|||
syntax match muLiteral %\<[0-9-]\?[0-9]\+\>%
|
||||
syntax match muLiteral %\<[0-9-]\?[0-9]\+/[^ ,]*%
|
||||
syntax match muLiteral "^\s\+[^ 0-9a-zA-Z{}#\[\]][^ ]*\s*$"
|
||||
" labels
|
||||
syntax match muLiteral %[^ ]\+:label/[^ ,]*\|[^ ]\+:label\>%
|
||||
syntax match muLiteral "<[^ ]*>"
|
||||
" other literal types
|
||||
syntax match muLiteral %[^ ]\+:type/[^ ,]*\|[^ ]\+:type\>%
|
||||
syntax match muLiteral %[^ ]\+:offset/[^ ,]*\|[^ ]\+:offset\>%
|
||||
syntax match muLiteral %[^ ]\+:variant/[^ ,]*\|[^ ]\+:variant\>%
|
||||
|
|
Loading…
Reference in New Issue
Block a user