diff options
Diffstat (limited to 'html/edit')
-rw-r--r-- | html/edit/001-editor.mu.html | 59 | ||||
-rw-r--r-- | html/edit/002-typing.mu.html | 91 | ||||
-rw-r--r-- | html/edit/003-shortcuts.mu.html | 153 | ||||
-rw-r--r-- | html/edit/004-programming-environment.mu.html | 55 | ||||
-rw-r--r-- | html/edit/005-sandbox.mu.html | 73 | ||||
-rw-r--r-- | html/edit/006-sandbox-edit.mu.html | 29 | ||||
-rw-r--r-- | html/edit/007-sandbox-delete.mu.html | 31 | ||||
-rw-r--r-- | html/edit/008-sandbox-test.mu.html | 35 | ||||
-rw-r--r-- | html/edit/009-sandbox-trace.mu.html | 33 | ||||
-rw-r--r-- | html/edit/010-errors.mu.html | 35 | ||||
-rw-r--r-- | html/edit/011-editor-undo.mu.html | 35 |
11 files changed, 265 insertions, 364 deletions
diff --git a/html/edit/001-editor.mu.html b/html/edit/001-editor.mu.html index ec683ce7..4ca8b427 100644 --- a/html/edit/001-editor.mu.html +++ b/html/edit/001-editor.mu.html @@ -3,41 +3,33 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/001-editor.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } +.Delimiter { color: #a04060; } .muControl { color: #c0a020; } -.muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .muData { color: #ffff00; } .Special { color: #ff6060; } -.Comment { color: #9090ff; } +.muScenario { color: #00af00; } .Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } +.Comment { color: #9090ff; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## the basic editor data structure, and how it displays text to the screen</span> <span class="Comment"># temporary main for this layer: just render the given text at the given</span> <span class="Comment"># screen dimensions, then stop</span> -<span class="muRecipe">recipe!</span> main text:address:shared:array:character [ +<span class="muRecipe">def!</span> main text:address:shared:array:character [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> open-console @@ -83,7 +75,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># creates a new editor widget and renders its initial appearance to screen</span> <span class="Comment"># top/left/right constrain the screen area available to the new editor</span> <span class="Comment"># right is exclusive</span> -<span class="muRecipe">recipe</span> new-editor s:address:shared:array:character, screen:address:shared:screen, left:number, right:number<span class="muRecipe"> -> </span>result:address:shared:editor-data, screen:address:shared:screen [ +<span class="muRecipe">def</span> new-editor s:address:shared:array:character, screen:address:shared:screen, left:number, right:number<span class="muRecipe"> -> </span>result:address:shared:editor-data, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># no clipping of bounds</span> @@ -114,13 +106,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant"> <editor-initialization></span> ] -<span class="muRecipe">recipe</span> insert-text editor:address:shared:editor-data, text:address:shared:array:character<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ +<span class="muRecipe">def</span> insert-text editor:address:shared:editor-data, text:address:shared:array:character<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># early exit if text is empty</span> - <span class="muControl">reply-unless</span> text, editor/same-as-ingredient:<span class="Constant">0</span> + <span class="muControl">return-unless</span> text, editor/same-as-ingredient:<span class="Constant">0</span> len:number<span class="Special"> <- </span>length *text - <span class="muControl">reply-unless</span> len, editor/same-as-ingredient:<span class="Constant">0</span> + <span class="muControl">return-unless</span> len, editor/same-as-ingredient:<span class="Constant">0</span> idx:number<span class="Special"> <- </span>copy <span class="Constant">0</span> <span class="Comment"># now we can start appending the rest, character by character</span> curr:address:shared:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> @@ -134,7 +126,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } idx<span class="Special"> <- </span>add idx, <span class="Constant">1</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> - <span class="muControl">reply</span> editor/same-as-ingredient:<span class="Constant">0</span> + <span class="muControl">return</span> editor/same-as-ingredient:<span class="Constant">0</span> ] <span class="muScenario">scenario</span> editor-initializes-without-data [ @@ -164,10 +156,10 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># Assumes cursor should be at coordinates (cursor-row, cursor-column) and</span> <span class="Comment"># updates before-cursor to match. Might also move coordinates if they're</span> <span class="Comment"># outside text.</span> -<span class="muRecipe">recipe</span> render screen:address:shared:screen, editor:address:shared:editor-data<span class="muRecipe"> -> </span>last-row:number, last-column:number, screen:address:shared:screen, editor:address:shared:editor-data [ +<span class="muRecipe">def</span> render screen:address:shared:screen, editor:address:shared:editor-data<span class="muRecipe"> -> </span>last-row:number, last-column:number, screen:address:shared:screen, editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">reply-unless</span> editor, <span class="Constant">1/top</span>, <span class="Constant">0/left</span>, screen/same-as-ingredient:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</span> + <span class="muControl">return-unless</span> editor, <span class="Constant">1/top</span>, <span class="Constant">0/left</span>, screen/same-as-ingredient:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</span> left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> screen-height:number<span class="Special"> <- </span>screen-height screen right:number<span class="Special"> <- </span>get *editor, <span class="Constant">right:offset</span> @@ -261,10 +253,10 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> bottom:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">bottom:offset</span> *bottom<span class="Special"> <- </span>copy row - <span class="muControl">reply</span> row, column, screen/same-as-ingredient:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</span> + <span class="muControl">return</span> row, column, screen/same-as-ingredient:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</span> ] -<span class="muRecipe">recipe</span> clear-line-delimited screen:address:shared:screen, column:number, right:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> clear-line-delimited screen:address:shared:screen, column:number, right:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> space:character<span class="Special"> <- </span>copy <span class="Constant">32/space</span> @@ -283,23 +275,23 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> clear-screen-from screen:address:shared:screen, row:number, column:number, left:number, right:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> clear-screen-from screen:address:shared:screen, row:number, column:number, left:number, right:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># if it's the real screen, use the optimized primitive</span> <span class="Delimiter">{</span> <span class="muControl">break-if</span> screen clear-display-from row, column, left, right - <span class="muControl">reply</span> screen/same-as-ingredient:<span class="Constant">0</span> + <span class="muControl">return</span> screen/same-as-ingredient:<span class="Constant">0</span> <span class="Delimiter">}</span> <span class="Comment"># if not, go the slower route</span> screen<span class="Special"> <- </span>move-cursor screen, row, column clear-line-delimited screen, column, right clear-rest-of-screen screen, row, left, right - <span class="muControl">reply</span> screen/same-as-ingredient:<span class="Constant">0</span> + <span class="muControl">return</span> screen/same-as-ingredient:<span class="Constant">0</span> ] -<span class="muRecipe">recipe</span> clear-rest-of-screen screen:address:shared:screen, row:number, left:number, right:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> clear-rest-of-screen screen:address:shared:screen, row:number, left:number, right:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> row<span class="Special"> <- </span>add row, <span class="Constant">1</span> @@ -457,7 +449,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># so far the previous color is all the information we need; that may change</span> -<span class="muRecipe">recipe</span> get-color color:number, c:character<span class="muRecipe"> -> </span>color:number [ +<span class="muRecipe">def</span> get-color color:number, c:character<span class="muRecipe"> -> </span>color:number [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> color-is-white?:boolean<span class="Special"> <- </span>equal color, <span class="Constant">7/white</span> @@ -499,7 +491,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> <span class="Comment"># otherwise no change</span> <span class="Constant"> +exit</span> - <span class="muControl">reply</span> color + <span class="muControl">return</span> color ] <span class="muScenario">scenario</span> render-colors-assignment [ @@ -528,4 +520,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/002-typing.mu.html b/html/edit/002-typing.mu.html index e36c71db..5b7d7872 100644 --- a/html/edit/002-typing.mu.html +++ b/html/edit/002-typing.mu.html @@ -3,41 +3,33 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/002-typing.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } +.muData { color: #ffff00; } +.muScenario { color: #00af00; } .muControl { color: #c0a020; } -.muRecipe { color: #ff8700; } +.Delimiter { color: #a04060; } .Special { color: #ff6060; } -.muData { color: #ffff00; } -.Comment { color: #9090ff; } .Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } +.Comment { color: #9090ff; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } -.muScenario { color: #00af00; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## handling events from the keyboard, mouse, touch screen, ...</span> <span class="Comment"># temporary main: interactive editor</span> <span class="Comment"># hit ctrl-c to exit</span> -<span class="muRecipe">recipe!</span> main text:address:shared:array:character [ +<span class="muRecipe">def!</span> main text:address:shared:array:character [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> open-console @@ -46,7 +38,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } close-console ] -<span class="muRecipe">recipe</span> editor-event-loop screen:address:shared:screen, console:address:shared:console, editor:address:shared:editor-data<span class="muRecipe"> -> </span>screen:address:shared:screen, console:address:shared:console, editor:address:shared:editor-data [ +<span class="muRecipe">def</span> editor-event-loop screen:address:shared:screen, console:address:shared:console, editor:address:shared:editor-data<span class="muRecipe"> -> </span>screen:address:shared:screen, console:address:shared:console, editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Delimiter">{</span> @@ -80,35 +72,35 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># process click, return if it was on current editor</span> -<span class="muRecipe">recipe</span> move-cursor-in-editor screen:address:shared:screen, editor:address:shared:editor-data, t:touch-event<span class="muRecipe"> -> </span>in-focus?:boolean, editor:address:shared:editor-data [ +<span class="muRecipe">def</span> move-cursor-in-editor screen:address:shared:screen, editor:address:shared:editor-data, t:touch-event<span class="muRecipe"> -> </span>in-focus?:boolean, editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">reply-unless</span> editor, <span class="Constant">0/false</span> + <span class="muControl">return-unless</span> editor, <span class="Constant">0/false</span> click-row:number<span class="Special"> <- </span>get t, <span class="Constant">row:offset</span> - <span class="muControl">reply-unless</span> click-row, <span class="Constant">0/false</span> <span class="Comment"># ignore clicks on 'menu'</span> + <span class="muControl">return-unless</span> click-row, <span class="Constant">0/false</span> <span class="Comment"># ignore clicks on 'menu'</span> click-column:number<span class="Special"> <- </span>get t, <span class="Constant">column:offset</span> left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> too-far-left?:boolean<span class="Special"> <- </span>lesser-than click-column, left - <span class="muControl">reply-if</span> too-far-left?, <span class="Constant">0/false</span> + <span class="muControl">return-if</span> too-far-left?, <span class="Constant">0/false</span> right:number<span class="Special"> <- </span>get *editor, <span class="Constant">right:offset</span> too-far-right?:boolean<span class="Special"> <- </span>greater-than click-column, right - <span class="muControl">reply-if</span> too-far-right?, <span class="Constant">0/false</span> + <span class="muControl">return-if</span> too-far-right?, <span class="Constant">0/false</span> <span class="Comment"># position cursor</span> <span class="Constant"> <move-cursor-begin></span> editor<span class="Special"> <- </span>snap-cursor screen, editor, click-row, click-column undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">0/never</span> <span class="Constant"> <move-cursor-end></span> <span class="Comment"># gain focus</span> - <span class="muControl">reply</span> <span class="Constant">1/true</span> + <span class="muControl">return</span> <span class="Constant">1/true</span> ] <span class="Comment"># Variant of 'render' that only moves the cursor (coordinates and</span> <span class="Comment"># before-cursor). If it's past the end of a line, it 'slides' it left. If it's</span> <span class="Comment"># past the last line it positions at end of last line.</span> -<span class="muRecipe">recipe</span> snap-cursor screen:address:shared:screen, editor:address:shared:editor-data, target-row:number, target-column:number<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ +<span class="muRecipe">def</span> snap-cursor screen:address:shared:screen, editor:address:shared:editor-data, target-row:number, target-column:number<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">reply-unless</span> editor + <span class="muControl">return-unless</span> editor left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> right:number<span class="Special"> <- </span>get *editor, <span class="Constant">right:offset</span> screen-height:number<span class="Special"> <- </span>screen-height screen @@ -190,11 +182,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># Process an event 'e' and try to minimally update the screen.</span> <span class="Comment"># Set 'go-render?' to true to indicate the caller must perform a non-minimal update.</span> -<span class="muRecipe">recipe</span> handle-keyboard-event screen:address:shared:screen, editor:address:shared:editor-data, e:event<span class="muRecipe"> -> </span>screen:address:shared:screen, editor:address:shared:editor-data, go-render?:boolean [ +<span class="muRecipe">def</span> handle-keyboard-event screen:address:shared:screen, editor:address:shared:editor-data, e:event<span class="muRecipe"> -> </span>screen:address:shared:screen, editor:address:shared:editor-data, go-render?:boolean [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-unless</span> editor + <span class="muControl">return-unless</span> editor screen-width:number<span class="Special"> <- </span>screen-width screen screen-height:number<span class="Special"> <- </span>screen-height screen left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> @@ -214,12 +206,12 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># ignore any other special characters</span> regular-character?:boolean<span class="Special"> <- </span>greater-or-equal *c, <span class="Constant">32/space</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-unless</span> regular-character? + <span class="muControl">return-unless</span> regular-character? <span class="Comment"># otherwise type it in</span> <span class="Constant"> <insert-character-begin></span> editor, screen, go-render?:boolean<span class="Special"> <- </span>insert-at-cursor editor, *c, screen <span class="Constant"> <insert-character-end></span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Comment"># special key to modify the text or move the cursor</span> k:address:number<span class="Special"> <- </span>maybe-convert e:event, <span class="Constant">keycode:variant</span> @@ -227,10 +219,10 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># handlers for each special key will go here</span> <span class="Constant"> <handle-special-key></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> ] -<span class="muRecipe">recipe</span> insert-at-cursor editor:address:shared:editor-data, c:character, screen:address:shared:screen<span class="muRecipe"> -> </span>editor:address:shared:editor-data, screen:address:shared:screen, go-render?:boolean [ +<span class="muRecipe">def</span> insert-at-cursor editor:address:shared:editor-data, c:character, screen:address:shared:screen<span class="muRecipe"> -> </span>editor:address:shared:editor-data, screen:address:shared:screen, go-render?:boolean [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:shared:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> @@ -261,7 +253,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } move-cursor screen, save-row, save-column print screen, c go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Delimiter">{</span> <span class="Comment"># not at right margin? print the character and rest of line</span> @@ -275,7 +267,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># hit right margin? give up and let caller render</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> at-right?:boolean<span class="Special"> <- </span>greater-than curr-column, right - <span class="muControl">reply-if</span> at-right? + <span class="muControl">return-if</span> at-right? <span class="muControl">break-unless</span> curr <span class="Comment"># newline? done.</span> currc:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> @@ -287,14 +279,14 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">loop</span> <span class="Delimiter">}</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> ] <span class="Comment"># helper for tests</span> -<span class="muRecipe">recipe</span> editor-render screen:address:shared:screen, editor:address:shared:editor-data<span class="muRecipe"> -> </span>screen:address:shared:screen, editor:address:shared:editor-data [ +<span class="muRecipe">def</span> editor-render screen:address:shared:screen, editor:address:shared:editor-data<span class="muRecipe"> -> </span>screen:address:shared:screen, editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> @@ -732,7 +724,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant"> <scroll-down></span> <span class="Delimiter">}</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -853,11 +845,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } editor<span class="Special"> <- </span>insert-new-line-and-indent editor, screen <span class="Constant"> <insert-enter-end></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> insert-new-line-and-indent editor:address:shared:editor-data, screen:address:shared:screen<span class="muRecipe"> -> </span>editor:address:shared:editor-data, screen:address:shared:screen, go-render?:boolean [ +<span class="muRecipe">def</span> insert-new-line-and-indent editor:address:shared:editor-data, screen:address:shared:screen<span class="muRecipe"> -> </span>editor:address:shared:editor-data, screen:address:shared:screen, go-render?:boolean [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> cursor-row:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-row:offset</span> @@ -881,7 +873,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> <span class="Comment"># indent if necessary</span> indent?:boolean<span class="Special"> <- </span>get *editor, <span class="Constant">indent?:offset</span> - <span class="muControl">reply-unless</span> indent? + <span class="muControl">return-unless</span> indent? d:address:shared:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> end-of-previous-line:address:shared:duplex-list:character<span class="Special"> <- </span>prev *before-cursor indent:number<span class="Special"> <- </span>line-indent end-of-previous-line, d @@ -897,13 +889,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># takes a pointer 'curr' into the doubly-linked list and its sentinel, counts</span> <span class="Comment"># the number of spaces at the start of the line containing 'curr'.</span> -<span class="muRecipe">recipe</span> line-indent curr:address:shared:duplex-list:character, start:address:shared:duplex-list:character<span class="muRecipe"> -> </span>result:number [ +<span class="muRecipe">def</span> line-indent curr:address:shared:duplex-list:character, start:address:shared:duplex-list:character<span class="muRecipe"> -> </span>result:number [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> result:number<span class="Special"> <- </span>copy <span class="Constant">0</span> - <span class="muControl">reply-unless</span> curr + <span class="muControl">return-unless</span> curr at-start?:boolean<span class="Special"> <- </span>equal curr, start - <span class="muControl">reply-if</span> at-start? + <span class="muControl">return-if</span> at-start? <span class="Delimiter">{</span> curr<span class="Special"> <- </span>prev curr <span class="muControl">break-unless</span> curr @@ -1030,7 +1022,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } indent?:address:boolean<span class="Special"> <- </span>get-address *editor, <span class="Constant">indent?:offset</span> *indent?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -1041,13 +1033,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } indent?:address:boolean<span class="Special"> <- </span>get-address *editor, <span class="Constant">indent?:offset</span> *indent?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] <span class="SalientComment">## helpers</span> -<span class="muRecipe">recipe</span> draw-horizontal screen:address:shared:screen, row:number, x:number, right:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> draw-horizontal screen:address:shared:screen, row:number, x:number, right:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> style:character, style-found?:boolean<span class="Special"> <- </span><span class="Constant">next-ingredient</span> @@ -1078,4 +1070,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/003-shortcuts.mu.html b/html/edit/003-shortcuts.mu.html index d3a4f5e8..ee6c44bc 100644 --- a/html/edit/003-shortcuts.mu.html +++ b/html/edit/003-shortcuts.mu.html @@ -3,35 +3,27 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/003-shortcuts.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } .muControl { color: #c0a020; } +.Delimiter { color: #a04060; } .muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .Special { color: #ff6060; } -.Comment { color: #9090ff; } .Constant { color: #00a0a0; } +.muScenario { color: #00af00; } +.Comment { color: #9090ff; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## special shortcuts for manipulating the editor</span> <span class="Comment"># Some keys on the keyboard generate unicode characters, others generate</span> <span class="Comment"># terminfo key codes. We need to modify different places in the two cases.</span> @@ -66,7 +58,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } editor, screen, go-render?:boolean<span class="Special"> <- </span>insert-at-cursor editor, <span class="Constant">32/space</span>, screen <span class="Constant"> <insert-character-end></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -107,14 +99,14 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant"> <backspace-character-begin></span> editor, screen, go-render?:boolean, backspaced-cell:address:shared:duplex-list:character<span class="Special"> <- </span>delete-before-cursor editor, screen <span class="Constant"> <backspace-character-end></span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] <span class="Comment"># return values:</span> <span class="Comment"># go-render? - whether caller needs to update the screen</span> <span class="Comment"># backspaced-cell - value deleted (or 0 if nothing was deleted) so we can save it for undo, etc.</span> -<span class="muRecipe">recipe</span> delete-before-cursor editor:address:shared:editor-data, screen:address:shared:screen<span class="muRecipe"> -> </span>editor:address:shared:editor-data, screen:address:shared:screen, go-render?:boolean, backspaced-cell:address:shared:duplex-list:character [ +<span class="muRecipe">def</span> delete-before-cursor editor:address:shared:editor-data, screen:address:shared:screen<span class="muRecipe"> -> </span>editor:address:shared:editor-data, screen:address:shared:screen, go-render?:boolean, backspaced-cell:address:shared:duplex-list:character [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:shared:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> @@ -122,7 +114,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># if at start of text (before-cursor at § sentinel), return</span> prev:address:shared:duplex-list:character<span class="Special"> <- </span>prev *before-cursor go-render?, backspaced-cell<span class="Special"> <- </span>copy <span class="Constant">0/no-more-render</span>, <span class="Constant">0/nothing-deleted</span> - <span class="muControl">reply-unless</span> prev + <span class="muControl">return-unless</span> prev trace <span class="Constant">10</span>, <span class="Constant">[app]</span>, <span class="Constant">[delete-before-cursor]</span> original-row:number<span class="Special"> <- </span>get *editor, <span class="Constant">cursor-row:offset</span> editor, scroll?:boolean<span class="Special"> <- </span>move-cursor-coordinates-left editor @@ -130,14 +122,14 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } data<span class="Special"> <- </span>remove *before-cursor, data <span class="Comment"># will also neatly trim next/prev pointers in backspaced-cell/*before-cursor</span> *before-cursor<span class="Special"> <- </span>copy prev go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply-if</span> scroll? + <span class="muControl">return-if</span> scroll? screen-width:number<span class="Special"> <- </span>screen-width screen cursor-row:number<span class="Special"> <- </span>get *editor, <span class="Constant">cursor-row:offset</span> cursor-column:number<span class="Special"> <- </span>get *editor, <span class="Constant">cursor-column:offset</span> <span class="Comment"># did we just backspace over a newline?</span> same-row?:boolean<span class="Special"> <- </span>equal cursor-row, original-row go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply-unless</span> same-row? + <span class="muControl">return-unless</span> same-row? left:number<span class="Special"> <- </span>get *editor, <span class="Constant">left:offset</span> right:number<span class="Special"> <- </span>get *editor, <span class="Constant">right:offset</span> curr:address:shared:duplex-list:character<span class="Special"> <- </span>next *before-cursor @@ -147,7 +139,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># hit right margin? give up and let caller render</span> at-right?:boolean<span class="Special"> <- </span>greater-or-equal curr-column, right go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply-if</span> at-right? + <span class="muControl">return-if</span> at-right? <span class="muControl">break-unless</span> curr <span class="Comment"># newline? done.</span> currc:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> @@ -164,7 +156,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> ] -<span class="muRecipe">recipe</span> move-cursor-coordinates-left editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data, go-render?:boolean [ +<span class="muRecipe">def</span> move-cursor-coordinates-left editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data, go-render?:boolean [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:shared:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">before-cursor:offset</span> @@ -178,7 +170,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } trace <span class="Constant">10</span>, <span class="Constant">[app]</span>, <span class="Constant">[decrementing cursor column]</span> *cursor-column<span class="Special"> <- </span>subtract *cursor-column, <span class="Constant">1</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Comment"># if at left margin, we must move to previous row:</span> top-of-screen?:boolean<span class="Special"> <- </span>equal *cursor-row, <span class="Constant">1</span> <span class="Comment"># exclude menu bar</span> @@ -213,7 +205,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break-if</span> wrap? *cursor-column<span class="Special"> <- </span>add left, end-of-line <span class="Delimiter">}</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Comment"># case 2: if previous-character was not newline, we're just at a wrapped line</span> trace <span class="Constant">10</span>, <span class="Constant">[app]</span>, <span class="Constant">[wrapping to previous line]</span> @@ -223,13 +215,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># takes a pointer 'curr' into the doubly-linked list and its sentinel, counts</span> <span class="Comment"># the length of the previous line before the 'curr' pointer.</span> -<span class="muRecipe">recipe</span> previous-line-length curr:address:shared:duplex-list:character, start:address:shared:duplex-list:character<span class="muRecipe"> -> </span>result:number [ +<span class="muRecipe">def</span> previous-line-length curr:address:shared:duplex-list:character, start:address:shared:duplex-list:character<span class="muRecipe"> -> </span>result:number [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> result:number<span class="Special"> <- </span>copy <span class="Constant">0</span> - <span class="muControl">reply-unless</span> curr + <span class="muControl">return-unless</span> curr at-start?:boolean<span class="Special"> <- </span>equal curr, start - <span class="muControl">reply-if</span> at-start? + <span class="muControl">return-if</span> at-start? <span class="Delimiter">{</span> curr<span class="Special"> <- </span>prev curr <span class="muControl">break-unless</span> curr @@ -372,23 +364,23 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant"> <delete-character-begin></span> editor, screen, go-render?:boolean, deleted-cell:address:shared:duplex-list:character<span class="Special"> <- </span>delete-at-cursor editor, screen <span class="Constant"> <delete-character-end></span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> delete-at-cursor editor:address:shared:editor-data, screen:address:shared:screen<span class="muRecipe"> -> </span>editor:address:shared:editor-data, screen:address:shared:screen, go-render?:boolean, deleted-cell:address:shared:duplex-list:character [ +<span class="muRecipe">def</span> delete-at-cursor editor:address:shared:editor-data, screen:address:shared:screen<span class="muRecipe"> -> </span>editor:address:shared:editor-data, screen:address:shared:screen, go-render?:boolean, deleted-cell:address:shared:duplex-list:character [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:shared:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> data:address:shared:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> deleted-cell:address:shared:duplex-list:character<span class="Special"> <- </span>next *before-cursor go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-unless</span> deleted-cell + <span class="muControl">return-unless</span> deleted-cell currc:character<span class="Special"> <- </span>get *deleted-cell, <span class="Constant">value:offset</span> data<span class="Special"> <- </span>remove deleted-cell, data deleted-newline?:boolean<span class="Special"> <- </span>equal currc, <span class="Constant">10/newline</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply-if</span> deleted-newline? + <span class="muControl">return-if</span> deleted-newline? <span class="Comment"># wasn't a newline? render rest of line</span> curr:address:shared:duplex-list:character<span class="Special"> <- </span>next *before-cursor <span class="Comment"># refresh after remove above</span> cursor-row:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-row:offset</span> @@ -400,7 +392,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># hit right margin? give up and let caller render</span> at-right?:boolean<span class="Special"> <- </span>greater-or-equal curr-column, screen-width go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply-if</span> at-right? + <span class="muControl">return-if</span> at-right? <span class="muControl">break-unless</span> curr <span class="Comment"># newline? done.</span> currc:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> @@ -455,11 +447,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } screen<span class="Special"> <- </span>move-cursor screen, *cursor-row, *cursor-column undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">2/right-arrow</span> <span class="Constant"> <move-cursor-end></span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> move-cursor-coordinates-right editor:address:shared:editor-data, screen-height:number<span class="muRecipe"> -> </span>editor:address:shared:editor-data, go-render?:boolean [ +<span class="muRecipe">def</span> move-cursor-coordinates-right editor:address:shared:editor-data, screen-height:number<span class="muRecipe"> -> </span>editor:address:shared:editor-data, go-render?:boolean [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:shared:duplex-list:character<span class="Special"> <- </span>get *editor <span class="Constant">before-cursor:offset</span> @@ -476,11 +468,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } *cursor-column<span class="Special"> <- </span>copy left below-screen?:boolean<span class="Special"> <- </span>greater-or-equal *cursor-row, screen-height <span class="Comment"># must be equal</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-unless</span> below-screen? + <span class="muControl">return-unless</span> below-screen? <span class="Constant"> <scroll-down></span> *cursor-row<span class="Special"> <- </span>subtract *cursor-row, <span class="Constant">1</span> <span class="Comment"># bring back into screen range</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Comment"># if the line wraps, move cursor to start of next row</span> <span class="Delimiter">{</span> @@ -497,11 +489,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } *cursor-row<span class="Special"> <- </span>add *cursor-row, <span class="Constant">1</span> *cursor-column<span class="Special"> <- </span>copy left below-screen?:boolean<span class="Special"> <- </span>greater-or-equal *cursor-row, screen-height <span class="Comment"># must be equal</span> - <span class="muControl">reply-unless</span> below-screen?, editor/same-as-ingredient:<span class="Constant">0</span>, <span class="Constant">0/no-more-render</span> + <span class="muControl">return-unless</span> below-screen?, editor/same-as-ingredient:<span class="Constant">0</span>, <span class="Constant">0/no-more-render</span> <span class="Constant"> <scroll-down></span> *cursor-row<span class="Special"> <- </span>subtract *cursor-row, <span class="Constant">1</span> <span class="Comment"># bring back into screen range</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Comment"># otherwise move cursor one character right</span> *cursor-column<span class="Special"> <- </span>add *cursor-column, <span class="Constant">1</span> @@ -725,13 +717,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># if not at start of text (before-cursor at § sentinel)</span> prev:address:shared:duplex-list:character<span class="Special"> <- </span>prev *before-cursor go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-unless</span> prev + <span class="muControl">return-unless</span> prev <span class="Constant"> <move-cursor-begin></span> editor, go-render?<span class="Special"> <- </span>move-cursor-coordinates-left editor *before-cursor<span class="Special"> <- </span>copy prev undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">1/left-arrow</span> <span class="Constant"> <move-cursor-end></span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -988,11 +980,11 @@ d] editor, go-render?<span class="Special"> <- </span>move-to-previous-line editor undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">3/up-arrow</span> <span class="Constant"> <move-cursor-end></span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> move-to-previous-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data, go-render?:boolean [ +<span class="muRecipe">def</span> move-to-previous-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data, go-render?:boolean [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> cursor-row:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-row:offset</span> @@ -1016,14 +1008,14 @@ d] curr:address:shared:duplex-list:character<span class="Special"> <- </span>before-previous-line curr, editor no-motion?:boolean<span class="Special"> <- </span>equal curr, old go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-if</span> no-motion? + <span class="muControl">return-if</span> no-motion? <span class="Delimiter">}</span> <span class="Delimiter">{</span> old<span class="Special"> <- </span>copy curr curr<span class="Special"> <- </span>before-previous-line curr, editor no-motion?:boolean<span class="Special"> <- </span>equal curr, old go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-if</span> no-motion? + <span class="muControl">return-if</span> no-motion? <span class="Delimiter">}</span> *before-cursor<span class="Special"> <- </span>copy curr *cursor-row<span class="Special"> <- </span>subtract *cursor-row, <span class="Constant">1</span> @@ -1044,14 +1036,14 @@ d] <span class="muControl">loop</span> <span class="Delimiter">}</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Delimiter">{</span> <span class="Comment"># if cursor already at top, scroll up</span> <span class="muControl">break-unless</span> already-at-top? <span class="Constant"> <scroll-up></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -1094,7 +1086,7 @@ d] <span class="muScenario">scenario</span> editor-adjusts-column-at-empty-line [ assume-screen <span class="Constant">10/width</span>, <span class="Constant">5/height</span> <span class="Constant">1</span>:address:shared:array:character<span class="Special"> <- </span>new [ -def] +<span class="muRecipe">def</span>] <span class="Constant">2</span>:address:shared:editor-data<span class="Special"> <- </span>new-editor <span class="Constant">1</span>:address:shared:array:character, screen:address:shared:screen, <span class="Constant">0/left</span>, <span class="Constant">10/right</span> editor-render screen, <span class="Constant">2</span>:address:shared:editor-data <span class="Constant"> $clear-trace</span> @@ -1213,11 +1205,11 @@ def] editor, go-render?<span class="Special"> <- </span>move-to-next-line editor, screen-height undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">4/down-arrow</span> <span class="Constant"> <move-cursor-end></span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> move-to-next-line editor:address:shared:editor-data, screen-height:number<span class="muRecipe"> -> </span>editor:address:shared:editor-data, go-render?:boolean [ +<span class="muRecipe">def</span> move-to-next-line editor:address:shared:editor-data, screen-height:number<span class="muRecipe"> -> </span>editor:address:shared:editor-data, go-render?:boolean [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> cursor-row:address:number<span class="Special"> <- </span>get-address *editor, <span class="Constant">cursor-row:offset</span> @@ -1241,7 +1233,7 @@ def] scroll?:boolean<span class="Special"> <- </span>greater-than *cursor-row, <span class="Constant">1</span> <span class="muControl">break-if</span> scroll?, <span class="Constant">+try-to-scroll:label</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> *cursor-row<span class="Special"> <- </span>add *cursor-row, <span class="Constant">1</span> *before-cursor<span class="Special"> <- </span>copy next-line @@ -1261,7 +1253,7 @@ def] <span class="muControl">loop</span> <span class="Delimiter">}</span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> <span class="Constant"> +try-to-scroll</span> <span class="Constant"> <scroll-down></span> @@ -1340,7 +1332,7 @@ def] undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">0/never</span> <span class="Constant"> <move-cursor-end></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -1353,11 +1345,11 @@ def] undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">0/never</span> <span class="Constant"> <move-cursor-end></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> move-to-start-of-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ +<span class="muRecipe">def</span> move-to-start-of-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># update cursor column</span> @@ -1511,7 +1503,7 @@ def] undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">0/never</span> <span class="Constant"> <move-cursor-end></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -1524,11 +1516,11 @@ def] undo-coalesce-tag:number<span class="Special"> <- </span>copy <span class="Constant">0/never</span> <span class="Constant"> <move-cursor-end></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> move-to-end-of-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ +<span class="muRecipe">def</span> move-to-end-of-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:shared:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> @@ -1654,11 +1646,11 @@ def] deleted-cells:address:shared:duplex-list:character<span class="Special"> <- </span>delete-to-start-of-line editor <span class="Constant"> <delete-to-start-of-line-end></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> delete-to-start-of-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>result:address:shared:duplex-list:character, editor:address:shared:editor-data [ +<span class="muRecipe">def</span> delete-to-start-of-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>result:address:shared:duplex-list:character, editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># compute range to delete</span> @@ -1788,11 +1780,11 @@ def] deleted-cells:address:shared:duplex-list:character<span class="Special"> <- </span>delete-to-end-of-line editor <span class="Constant"> <delete-to-end-of-line-end></span> go-render?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> delete-to-end-of-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>result:address:shared:duplex-list:character, editor:address:shared:editor-data [ +<span class="muRecipe">def</span> delete-to-end-of-line editor:address:shared:editor-data<span class="muRecipe"> -> </span>result:address:shared:duplex-list:character, editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># compute range to delete</span> @@ -1971,13 +1963,13 @@ def] *top-of-screen<span class="Special"> <- </span>before-start-of-next-line *top-of-screen, max no-movement?:boolean<span class="Special"> <- </span>equal old-top, *top-of-screen go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-if</span> no-movement? + <span class="muControl">return-if</span> no-movement? ] <span class="Comment"># takes a pointer into the doubly-linked list, scans ahead at most 'max'</span> <span class="Comment"># positions until the next newline</span> <span class="Comment"># beware: never return null pointer.</span> -<span class="muRecipe">recipe</span> before-start-of-next-line original:address:shared:duplex-list:character, max:number<span class="muRecipe"> -> </span>curr:address:shared:duplex-list:character [ +<span class="muRecipe">def</span> before-start-of-next-line original:address:shared:duplex-list:character, max:number<span class="muRecipe"> -> </span>curr:address:shared:duplex-list:character [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> count:number<span class="Special"> <- </span>copy <span class="Constant">0</span> @@ -1991,7 +1983,7 @@ def] count<span class="Special"> <- </span>add count, <span class="Constant">1</span> <span class="Delimiter">}</span> <span class="Delimiter">{</span> - <span class="muControl">reply-unless</span> curr, original + <span class="muControl">return-unless</span> curr, original done?:boolean<span class="Special"> <- </span>greater-or-equal count, max <span class="muControl">break-if</span> done? c:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> @@ -2001,8 +1993,8 @@ def] count<span class="Special"> <- </span>add count, <span class="Constant">1</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> - <span class="muControl">reply-unless</span> curr, original - <span class="muControl">reply</span> curr + <span class="muControl">return-unless</span> curr, original + <span class="muControl">return</span> curr ] <span class="muScenario">scenario</span> editor-scrolls-down-past-wrapped-line-using-arrow-keys [ @@ -2338,13 +2330,13 @@ def] *top-of-screen<span class="Special"> <- </span>before-previous-line *top-of-screen, editor no-movement?:boolean<span class="Special"> <- </span>equal old-top, *top-of-screen go-render?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> - <span class="muControl">reply-if</span> no-movement? + <span class="muControl">return-if</span> no-movement? ] <span class="Comment"># takes a pointer into the doubly-linked list, scans back to before start of</span> <span class="Comment"># previous *wrapped* line</span> <span class="Comment"># beware: never return null pointer</span> -<span class="muRecipe">recipe</span> before-previous-line in:address:shared:duplex-list:character, editor:address:shared:editor-data<span class="muRecipe"> -> </span>out:address:shared:duplex-list:character [ +<span class="muRecipe">def</span> before-previous-line in:address:shared:duplex-list:character, editor:address:shared:editor-data<span class="muRecipe"> -> </span>out:address:shared:duplex-list:character [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> curr:address:shared:duplex-list:character<span class="Special"> <- </span>copy in @@ -2361,8 +2353,8 @@ def] <span class="muControl">break-if</span> len <span class="Comment"># empty line; just skip this newline</span> prev:address:shared:duplex-list:character<span class="Special"> <- </span>prev curr - <span class="muControl">reply-unless</span> prev, curr - <span class="muControl">reply</span> prev + <span class="muControl">return-unless</span> prev, curr + <span class="muControl">return</span> prev <span class="Delimiter">}</span> _, max:number<span class="Special"> <- </span>divide-with-remainder len, max-line-length <span class="Comment"># remainder 0 => scan one width-worth</span> @@ -2382,7 +2374,7 @@ def] count<span class="Special"> <- </span>add count, <span class="Constant">1</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> - <span class="muControl">reply</span> curr + <span class="muControl">return</span> curr ] <span class="muScenario">scenario</span> editor-scrolls-up-past-wrapped-line-using-arrow-keys [ @@ -2732,7 +2724,7 @@ e] <span class="Constant"> <move-cursor-end></span> no-movement?:boolean<span class="Special"> <- </span>equal *top-of-screen, old-top go-render?<span class="Special"> <- </span>not no-movement? - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -2748,18 +2740,18 @@ e] <span class="Constant"> <move-cursor-end></span> no-movement?:boolean<span class="Special"> <- </span>equal *top-of-screen, old-top go-render?<span class="Special"> <- </span>not no-movement? - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] <span class="Comment"># page-down skips entire wrapped lines, so it can't scroll past lines</span> <span class="Comment"># taking up the entire screen</span> -<span class="muRecipe">recipe</span> page-down editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ +<span class="muRecipe">def</span> page-down editor:address:shared:editor-data<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># if editor contents don't overflow screen, do nothing</span> bottom-of-screen:address:shared:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">bottom-of-screen:offset</span> - <span class="muControl">reply-unless</span> bottom-of-screen + <span class="muControl">return-unless</span> bottom-of-screen <span class="Comment"># if not, position cursor at final character</span> before-cursor:address:address:shared:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> *before-cursor<span class="Special"> <- </span>prev bottom-of-screen @@ -2924,7 +2916,7 @@ e] <span class="Constant"> <move-cursor-end></span> no-movement?:boolean<span class="Special"> <- </span>equal *top-of-screen, old-top go-render?<span class="Special"> <- </span>not no-movement? - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -2941,11 +2933,11 @@ e] no-movement?:boolean<span class="Special"> <- </span>equal *top-of-screen, old-top <span class="Comment"># don't bother re-rendering if nothing changed. todo: test this</span> go-render?<span class="Special"> <- </span>not no-movement? - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> page-up editor:address:shared:editor-data, screen-height:number<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ +<span class="muRecipe">def</span> page-up editor:address:shared:editor-data, screen-height:number<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> max:number<span class="Special"> <- </span>subtract screen-height, <span class="Constant">1/menu-bar</span>, <span class="Constant">1/overlapping-line</span> @@ -3250,4 +3242,3 @@ gxy </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/004-programming-environment.mu.html b/html/edit/004-programming-environment.mu.html index 4b9e508c..4fd659fd 100644 --- a/html/edit/004-programming-environment.mu.html +++ b/html/edit/004-programming-environment.mu.html @@ -3,42 +3,34 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/004-programming-environment.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } +.muScenario { color: #00af00; } .muControl { color: #c0a020; } -.muRecipe { color: #ff8700; } -.Special { color: #ff6060; } +.Delimiter { color: #a04060; } .muData { color: #ffff00; } -.Comment { color: #9090ff; } +.Special { color: #ff6060; } .Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } +.Comment { color: #9090ff; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } -.muScenario { color: #00af00; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## putting the environment together out of editors</span> <span class="Comment">#</span> <span class="Comment"># Consists of one editor on the left for recipes and one on the right for the</span> <span class="Comment"># sandbox.</span> -<span class="muRecipe">recipe!</span> main [ +<span class="muRecipe">def!</span> main [ <span class="Constant">local-scope</span> open-console initial-recipe:address:shared:array:character<span class="Special"> <- </span>restore <span class="Constant">[recipes.mu]</span> @@ -56,7 +48,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } sandbox-in-focus?:boolean <span class="Comment"># false => cursor in recipes; true => cursor in current-sandbox</span> ] -<span class="muRecipe">recipe</span> new-programming-environment screen:address:shared:screen, initial-recipe-contents:address:shared:array:character, initial-sandbox-contents:address:shared:array:character<span class="muRecipe"> -> </span>result:address:shared:programming-environment-data, screen:address:shared:screen [ +<span class="muRecipe">def</span> new-programming-environment screen:address:shared:screen, initial-recipe-contents:address:shared:array:character, initial-sandbox-contents:address:shared:array:character<span class="muRecipe"> -> </span>result:address:shared:programming-environment-data, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> width:number<span class="Special"> <- </span>screen-width screen @@ -83,7 +75,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant"> <programming-environment-initialization></span> ] -<span class="muRecipe">recipe</span> event-loop screen:address:shared:screen, console:address:shared:console, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen, console:address:shared:console, env:address:shared:programming-environment-data [ +<span class="muRecipe">def</span> event-loop screen:address:shared:screen, console:address:shared:console, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen, console:address:shared:console, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> recipes:address:shared:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">recipes:offset</span> @@ -215,7 +207,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> resize screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>env:address:shared:programming-environment-data, screen:address:shared:screen [ +<span class="muRecipe">def</span> resize screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>env:address:shared:programming-environment-data, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> clear-screen screen <span class="Comment"># update screen dimensions</span> @@ -407,7 +399,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] ] -<span class="muRecipe">recipe</span> render-all screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> render-all screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> trace <span class="Constant">10</span>, <span class="Constant">[app]</span>, <span class="Constant">[render all]</span> @@ -440,7 +432,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } show-screen screen ] -<span class="muRecipe">recipe</span> render-recipes screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> render-recipes screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> trace <span class="Constant">11</span>, <span class="Constant">[app]</span>, <span class="Constant">[render recipes]</span> @@ -459,7 +451,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># replaced in a later layer</span> -<span class="muRecipe">recipe</span> render-sandbox-side screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> render-sandbox-side screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> current-sandbox:address:shared:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> @@ -474,7 +466,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } clear-screen-from screen, row, left, left, right ] -<span class="muRecipe">recipe</span> update-cursor screen:address:shared:screen, recipes:address:shared:editor-data, current-sandbox:address:shared:editor-data, sandbox-in-focus?:boolean, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> update-cursor screen:address:shared:screen, recipes:address:shared:editor-data, current-sandbox:address:shared:editor-data, sandbox-in-focus?:boolean, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Constant"> <update-cursor-special-cases></span> @@ -493,10 +485,10 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># print a text 's' to 'editor' in 'color' starting at 'row'</span> <span class="Comment"># clear rest of last line, move cursor to next line</span> -<span class="muRecipe">recipe</span> render screen:address:shared:screen, s:address:shared:array:character, left:number, right:number, color:number, row:number<span class="muRecipe"> -> </span>row:number, screen:address:shared:screen [ +<span class="muRecipe">def</span> render screen:address:shared:screen, s:address:shared:array:character, left:number, right:number, color:number, row:number<span class="muRecipe"> -> </span>row:number, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">reply-unless</span> s + <span class="muControl">return-unless</span> s column:number<span class="Special"> <- </span>copy left screen<span class="Special"> <- </span>move-cursor screen, row, column screen-height:number<span class="Special"> <- </span>screen-height screen @@ -554,10 +546,10 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># like 'render' for texts, but with colorization for comments like in the editor</span> -<span class="muRecipe">recipe</span> render-code screen:address:shared:screen, s:address:shared:array:character, left:number, right:number, row:number<span class="muRecipe"> -> </span>row:number, screen:address:shared:screen [ +<span class="muRecipe">def</span> render-code screen:address:shared:screen, s:address:shared:array:character, left:number, right:number, row:number<span class="muRecipe"> -> </span>row:number, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">reply-unless</span> s + <span class="muControl">return-unless</span> s color:number<span class="Special"> <- </span>copy <span class="Constant">7/white</span> column:number<span class="Special"> <- </span>copy left screen<span class="Special"> <- </span>move-cursor screen, row, column @@ -643,7 +635,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="SalientComment">## helpers</span> -<span class="muRecipe">recipe</span> draw-vertical screen:address:shared:screen, col:number, y:number, bottom:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> draw-vertical screen:address:shared:screen, col:number, y:number, bottom:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> style:character, style-found?:boolean<span class="Special"> <- </span><span class="Constant">next-ingredient</span> @@ -669,4 +661,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/005-sandbox.mu.html b/html/edit/005-sandbox.mu.html index c48f90d7..9dcb6ff3 100644 --- a/html/edit/005-sandbox.mu.html +++ b/html/edit/005-sandbox.mu.html @@ -3,43 +3,35 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/005-sandbox.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } .muControl { color: #c0a020; } -.muRecipe { color: #ff8700; } -.Special { color: #ff6060; } +.Delimiter { color: #a04060; } +.muScenario { color: #00af00; } .muData { color: #ffff00; } -.Comment { color: #9090ff; } +.Special { color: #ff6060; } .Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } +.Comment { color: #9090ff; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } -.muScenario { color: #00af00; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## running code from the editor and creating sandboxes</span> <span class="Comment">#</span> <span class="Comment"># Running code in the sandbox editor prepends its contents to a list of</span> <span class="Comment"># (non-editable) sandboxes below the editor, showing the result and a maybe</span> <span class="Comment"># few other things.</span> -<span class="muRecipe">recipe!</span> main [ +<span class="muRecipe">def!</span> main [ <span class="Constant">local-scope</span> open-console initial-recipe:address:shared:array:character<span class="Special"> <- </span>restore <span class="Constant">[recipes.mu]</span> @@ -177,11 +169,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> run-sandboxes env:address:shared:programming-environment-data, screen:address:shared:screen<span class="muRecipe"> -> </span>errors-found?:boolean, env:address:shared:programming-environment-data, screen:address:shared:screen [ +<span class="muRecipe">def</span> run-sandboxes env:address:shared:programming-environment-data, screen:address:shared:screen<span class="muRecipe"> -> </span>errors-found?:boolean, env:address:shared:programming-environment-data, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> errors-found?:boolean, env, screen<span class="Special"> <- </span>update-recipes env, screen - <span class="muControl">reply-if</span> errors-found? + <span class="muControl">return-if</span> errors-found? <span class="Comment"># check contents of right editor (sandbox)</span> <span class="Constant"> <run-sandboxes-begin></span> current-sandbox:address:shared:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> @@ -224,7 +216,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># copy code from recipe editor, persist, load into mu</span> <span class="Comment"># replaced in a later layer (whereupon errors-found? will actually be set)</span> -<span class="muRecipe">recipe</span> update-recipes env:address:shared:programming-environment-data, screen:address:shared:screen<span class="muRecipe"> -> </span>errors-found?:boolean, env:address:shared:programming-environment-data, screen:address:shared:screen [ +<span class="muRecipe">def</span> update-recipes env:address:shared:programming-environment-data, screen:address:shared:screen<span class="muRecipe"> -> </span>errors-found?:boolean, env:address:shared:programming-environment-data, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> recipes:address:shared:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">recipes:offset</span> @@ -235,7 +227,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># replaced in a later layer</span> -<span class="muRecipe">recipe!</span> update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ +<span class="muRecipe">def!</span> update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> data:address:shared:array:character<span class="Special"> <- </span>get *sandbox, <span class="Constant">data:offset</span> @@ -244,14 +236,14 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } *response, _, *fake-screen<span class="Special"> <- </span>run-interactive data ] -<span class="muRecipe">recipe</span> update-status screen:address:shared:screen, msg:address:shared:array:character, color:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def</span> update-status screen:address:shared:screen, msg:address:shared:array:character, color:number<span class="muRecipe"> -> </span>screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> screen<span class="Special"> <- </span>move-cursor screen, <span class="Constant">0</span>, <span class="Constant">2</span> screen<span class="Special"> <- </span>print screen, msg, color, <span class="Constant">238/grey/background</span> ] -<span class="muRecipe">recipe</span> save-sandboxes env:address:shared:programming-environment-data [ +<span class="muRecipe">def</span> save-sandboxes env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> current-sandbox:address:shared:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> @@ -272,7 +264,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe!</span> render-sandbox-side screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen [ +<span class="muRecipe">def!</span> render-sandbox-side screen:address:shared:screen, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>screen:address:shared:screen, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> trace <span class="Constant">11</span>, <span class="Constant">[app]</span>, <span class="Constant">[render sandbox side]</span> @@ -296,13 +288,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } clear-rest-of-screen screen, row, left, right ] -<span class="muRecipe">recipe</span> render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number, render-from:number, idx:number<span class="muRecipe"> -> </span>row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [ +<span class="muRecipe">def</span> render-sandboxes screen:address:shared:screen, sandbox:address:shared:sandbox-data, left:number, right:number, row:number, render-from:number, idx:number<span class="muRecipe"> -> </span>row:number, screen:address:shared:screen, sandbox:address:shared:sandbox-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">reply-unless</span> sandbox + <span class="muControl">return-unless</span> sandbox screen-height:number<span class="Special"> <- </span>screen-height screen at-bottom?:boolean<span class="Special"> <- </span>greater-or-equal row, screen-height - <span class="muControl">reply-if</span> at-bottom?:boolean + <span class="muControl">return-if</span> at-bottom?:boolean hidden?:boolean<span class="Special"> <- </span>lesser-than idx, render-from <span class="Delimiter">{</span> <span class="muControl">break-if</span> hidden? @@ -339,7 +331,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> <span class="Constant"> +render-sandbox-end</span> at-bottom?:boolean<span class="Special"> <- </span>greater-or-equal row, screen-height - <span class="muControl">reply-if</span> at-bottom? + <span class="muControl">return-if</span> at-bottom? <span class="Comment"># draw solid line after sandbox</span> draw-horizontal screen, row, left, right, <span class="Constant">9473/horizontal-double</span> <span class="Delimiter">}</span> @@ -359,7 +351,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># assumes programming environment has no sandboxes; restores them from previous session</span> -<span class="muRecipe">recipe</span> restore-sandboxes env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>env:address:shared:programming-environment-data [ +<span class="muRecipe">def</span> restore-sandboxes env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># read all scenarios, pushing them to end of a list of scenarios</span> @@ -393,10 +385,10 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># print the fake sandbox screen to 'screen' with appropriate delimiters</span> <span class="Comment"># leave cursor at start of next line</span> -<span class="muRecipe">recipe</span> render-screen screen:address:shared:screen, sandbox-screen:address:shared:screen, left:number, right:number, row:number<span class="muRecipe"> -> </span>row:number, screen:address:shared:screen [ +<span class="muRecipe">def</span> render-screen screen:address:shared:screen, sandbox-screen:address:shared:screen, left:number, right:number, row:number<span class="muRecipe"> -> </span>row:number, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - <span class="muControl">reply-unless</span> sandbox-screen + <span class="muControl">return-unless</span> sandbox-screen <span class="Comment"># print 'screen:'</span> header:address:shared:array:character<span class="Special"> <- </span>new <span class="Constant">[screen:]</span> row<span class="Special"> <- </span>render screen, header, left, right, <span class="Constant">245/grey</span>, row @@ -545,7 +537,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] ] -<span class="muRecipe">recipe</span> editor-contents editor:address:shared:editor-data<span class="muRecipe"> -> </span>result:address:shared:array:character [ +<span class="muRecipe">def</span> editor-contents editor:address:shared:editor-data<span class="muRecipe"> -> </span>result:address:shared:array:character [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> buf:address:shared:buffer<span class="Special"> <- </span>new-buffer <span class="Constant">80</span> @@ -553,7 +545,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># skip § sentinel</span> assert curr, <span class="Constant">[editor without data is illegal; must have at least a sentinel]</span> curr<span class="Special"> <- </span>next curr - <span class="muControl">reply-unless</span> curr, <span class="Constant">0</span> + <span class="muControl">return-unless</span> curr, <span class="Constant">0</span> <span class="Delimiter">{</span> <span class="muControl">break-unless</span> curr c:character<span class="Special"> <- </span>get *curr, <span class="Constant">value:offset</span> @@ -690,7 +682,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break-unless</span> scrolling? cursor-column:number<span class="Special"> <- </span>get *current-sandbox, <span class="Constant">left:offset</span> screen<span class="Special"> <- </span>move-cursor screen, <span class="Constant">2/row</span>, cursor-column <span class="Comment"># highlighted sandbox will always start at row 2</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> ] @@ -713,21 +705,21 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># sandbox belonging to 'env' whose next-sandbox is 'in'</span> <span class="Comment"># return 0 if there's no such sandbox, either because 'in' doesn't exist in 'env', or because it's the first sandbox</span> -<span class="muRecipe">recipe</span> previous-sandbox env:address:shared:programming-environment-data, in:address:shared:sandbox-data<span class="muRecipe"> -> </span>out:address:shared:sandbox-data [ +<span class="muRecipe">def</span> previous-sandbox env:address:shared:programming-environment-data, in:address:shared:sandbox-data<span class="muRecipe"> -> </span>out:address:shared:sandbox-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> curr:address:shared:sandbox-data<span class="Special"> <- </span>get *env, <span class="Constant">sandbox:offset</span> - <span class="muControl">reply-unless</span> curr, <span class="Constant">0/nil</span> + <span class="muControl">return-unless</span> curr, <span class="Constant">0/nil</span> next:address:shared:sandbox-data<span class="Special"> <- </span>get *curr, <span class="Constant">next-sandbox:offset</span> <span class="Delimiter">{</span> - <span class="muControl">reply-unless</span> next, <span class="Constant">0/nil</span> + <span class="muControl">return-unless</span> next, <span class="Constant">0/nil</span> found?:boolean<span class="Special"> <- </span>equal next, in <span class="muControl">break-if</span> found? curr<span class="Special"> <- </span>copy next next<span class="Special"> <- </span>get *curr, <span class="Constant">next-sandbox:offset</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> - <span class="muControl">reply</span> curr + <span class="muControl">return</span> curr ] <span class="muScenario">scenario</span> scrolling-down-on-recipe-side [ @@ -1003,4 +995,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/006-sandbox-edit.mu.html b/html/edit/006-sandbox-edit.mu.html index f5b59339..f6a737b2 100644 --- a/html/edit/006-sandbox-edit.mu.html +++ b/html/edit/006-sandbox-edit.mu.html @@ -3,35 +3,27 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/006-sandbox-edit.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } .muControl { color: #c0a020; } +.Delimiter { color: #a04060; } .muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .Special { color: #ff6060; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } +.muScenario { color: #00af00; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## editing sandboxes after they've been created</span> <span class="muScenario">scenario</span> clicking-on-a-sandbox-moves-it-to-editor [ @@ -126,7 +118,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> empty-editor? editor:address:shared:editor-data<span class="muRecipe"> -> </span>result:boolean [ +<span class="muRecipe">def</span> empty-editor? editor:address:shared:editor-data<span class="muRecipe"> -> </span>result:boolean [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> head:address:shared:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> @@ -134,13 +126,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } result<span class="Special"> <- </span>not first ] -<span class="muRecipe">recipe</span> extract-sandbox env:address:shared:programming-environment-data, click-row:number<span class="muRecipe"> -> </span>result:address:shared:sandbox-data, env:address:shared:programming-environment-data [ +<span class="muRecipe">def</span> extract-sandbox env:address:shared:programming-environment-data, click-row:number<span class="muRecipe"> -> </span>result:address:shared:sandbox-data, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> sandbox:address:address:shared:sandbox-data<span class="Special"> <- </span>get-address *env, <span class="Constant">sandbox:offset</span> start:number<span class="Special"> <- </span>get **sandbox, <span class="Constant">starting-row-on-screen:offset</span> in-editor?:boolean<span class="Special"> <- </span>lesser-than click-row, start - <span class="muControl">reply-if</span> in-editor?, <span class="Constant">0</span> + <span class="muControl">return-if</span> in-editor?, <span class="Constant">0</span> <span class="Delimiter">{</span> next-sandbox:address:shared:sandbox-data<span class="Special"> <- </span>get **sandbox, <span class="Constant">next-sandbox:offset</span> <span class="muControl">break-unless</span> next-sandbox @@ -323,4 +315,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/007-sandbox-delete.mu.html b/html/edit/007-sandbox-delete.mu.html index 954dcd58..a41e9466 100644 --- a/html/edit/007-sandbox-delete.mu.html +++ b/html/edit/007-sandbox-delete.mu.html @@ -3,35 +3,27 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/007-sandbox-delete.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } .muControl { color: #c0a020; } +.Delimiter { color: #a04060; } .muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .Special { color: #ff6060; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } +.muScenario { color: #00af00; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## deleting sandboxes</span> <span class="muScenario">scenario</span> deleting-sandboxes [ @@ -111,14 +103,14 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> delete-sandbox t:touch-event, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>was-delete?:boolean, env:address:shared:programming-environment-data [ +<span class="muRecipe">def</span> delete-sandbox t:touch-event, env:address:shared:programming-environment-data<span class="muRecipe"> -> </span>was-delete?:boolean, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> click-column:number<span class="Special"> <- </span>get t, <span class="Constant">column:offset</span> current-sandbox:address:shared:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> right:number<span class="Special"> <- </span>get *current-sandbox, <span class="Constant">right:offset</span> at-right?:boolean<span class="Special"> <- </span>equal click-column, right - <span class="muControl">reply-unless</span> at-right?, <span class="Constant">0/false</span> + <span class="muControl">return-unless</span> at-right?, <span class="Constant">0/false</span> click-row:number<span class="Special"> <- </span>get t, <span class="Constant">row:offset</span> prev:address:address:shared:sandbox-data<span class="Special"> <- </span>get-address *env, <span class="Constant">sandbox:offset</span> curr:address:shared:sandbox-data<span class="Special"> <- </span>get *env, <span class="Constant">sandbox:offset</span> @@ -142,13 +134,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">break-unless</span> reset-scroll? *render-from<span class="Special"> <- </span>copy <span class="Constant">-1</span> <span class="Delimiter">}</span> - <span class="muControl">reply</span> <span class="Constant">1/true</span> <span class="Comment"># force rerender</span> + <span class="muControl">return</span> <span class="Constant">1/true</span> <span class="Comment"># force rerender</span> <span class="Delimiter">}</span> prev<span class="Special"> <- </span>get-address *curr, <span class="Constant">next-sandbox:offset</span> curr<span class="Special"> <- </span>get *curr, <span class="Constant">next-sandbox:offset</span> <span class="muControl">loop</span> <span class="Delimiter">}</span> - <span class="muControl">reply</span> <span class="Constant">0/false</span> + <span class="muControl">return</span> <span class="Constant">0/false</span> ] <span class="muScenario">scenario</span> deleting-sandbox-after-scroll [ @@ -343,4 +335,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/008-sandbox-test.mu.html b/html/edit/008-sandbox-test.mu.html index 28a098ae..208636a5 100644 --- a/html/edit/008-sandbox-test.mu.html +++ b/html/edit/008-sandbox-test.mu.html @@ -3,36 +3,28 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/008-sandbox-test.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } .muControl { color: #c0a020; } +.Delimiter { color: #a04060; } .muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .muData { color: #ffff00; } .Special { color: #ff6060; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } +.muScenario { color: #00af00; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## clicking on sandbox results to 'fix' them and turn sandboxes into tests</span> <span class="muScenario">scenario</span> sandbox-click-on-result-toggles-color-to-green [ @@ -167,7 +159,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> find-click-in-sandbox-output env:address:shared:programming-environment-data, click-row:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data [ +<span class="muRecipe">def</span> find-click-in-sandbox-output env:address:shared:programming-environment-data, click-row:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># assert click-row >= sandbox.starting-row-on-screen</span> @@ -187,13 +179,13 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> <span class="Comment"># return sandbox if click is in its output region</span> response-starting-row:number<span class="Special"> <- </span>get *sandbox, <span class="Constant">response-starting-row-on-screen:offset</span> - <span class="muControl">reply-unless</span> response-starting-row, <span class="Constant">0/no-click-in-sandbox-output</span> + <span class="muControl">return-unless</span> response-starting-row, <span class="Constant">0/no-click-in-sandbox-output</span> click-in-response?:boolean<span class="Special"> <- </span>greater-or-equal click-row, response-starting-row - <span class="muControl">reply-unless</span> click-in-response?, <span class="Constant">0/no-click-in-sandbox-output</span> - <span class="muControl">reply</span> sandbox + <span class="muControl">return-unless</span> click-in-response?, <span class="Constant">0/no-click-in-sandbox-output</span> + <span class="muControl">return</span> sandbox ] -<span class="muRecipe">recipe</span> toggle-expected-response sandbox:address:shared:sandbox-data<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data [ +<span class="muRecipe">def</span> toggle-expected-response sandbox:address:shared:sandbox-data<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> expected-response:address:address:shared:array:character<span class="Special"> <- </span>get-address *sandbox, <span class="Constant">expected-response:offset</span> @@ -201,7 +193,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># if expected-response is set, reset</span> <span class="muControl">break-unless</span> *expected-response *expected-response<span class="Special"> <- </span>copy <span class="Constant">0</span> - <span class="muControl">reply</span> sandbox/same-as-ingredient:<span class="Constant">0</span> + <span class="muControl">return</span> sandbox/same-as-ingredient:<span class="Constant">0</span> <span class="Delimiter">}</span> <span class="Comment"># if not, current response is the expected response</span> response:address:shared:array:character<span class="Special"> <- </span>get *sandbox, <span class="Constant">response:offset</span> @@ -236,4 +228,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/009-sandbox-trace.mu.html b/html/edit/009-sandbox-trace.mu.html index 868d68fc..7a88ee9e 100644 --- a/html/edit/009-sandbox-trace.mu.html +++ b/html/edit/009-sandbox-trace.mu.html @@ -3,36 +3,28 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/009-sandbox-trace.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } -.muControl { color: #c0a020; } +.Delimiter { color: #a04060; } .muRecipe { color: #ff8700; } -.muScenario { color: #00af00; } .muData { color: #ffff00; } +.muControl { color: #c0a020; } .Special { color: #ff6060; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } +.muScenario { color: #00af00; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## clicking on the code typed into a sandbox toggles its trace</span> <span class="muScenario">scenario</span> sandbox-click-on-code-toggles-app-trace [ @@ -162,7 +154,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># replaced in a later layer</span> -<span class="muRecipe">recipe!</span> update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ +<span class="muRecipe">def!</span> update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> data:address:shared:array:character<span class="Special"> <- </span>get *sandbox, <span class="Constant">data:offset</span> @@ -201,7 +193,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> find-click-in-sandbox-code env:address:shared:programming-environment-data, click-row:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data [ +<span class="muRecipe">def</span> find-click-in-sandbox-code env:address:shared:programming-environment-data, click-row:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># assert click-row >= sandbox.starting-row-on-screen</span> @@ -227,9 +219,9 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } click-on-sandbox-code?:boolean<span class="Special"> <- </span>and click-above-response?, click-below-menu? <span class="Delimiter">{</span> <span class="muControl">break-if</span> click-on-sandbox-code? - <span class="muControl">reply</span> <span class="Constant">0/no-click-in-sandbox-output</span> + <span class="muControl">return</span> <span class="Constant">0/no-click-in-sandbox-output</span> <span class="Delimiter">}</span> - <span class="muControl">reply</span> sandbox + <span class="muControl">return</span> sandbox ] <span class="Comment"># when rendering a sandbox, dump its trace before response/warning if display-trace? property is set</span> @@ -246,4 +238,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/010-errors.mu.html b/html/edit/010-errors.mu.html index 1616c8cf..aff63491 100644 --- a/html/edit/010-errors.mu.html +++ b/html/edit/010-errors.mu.html @@ -3,36 +3,28 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/010-errors.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } +.muScenario { color: #00af00; } .muControl { color: #c0a020; } -.muRecipe { color: #ff8700; } +.Delimiter { color: #a04060; } .Special { color: #ff6060; } -.muData { color: #ffff00; } -.Comment { color: #9090ff; } .Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } +.Comment { color: #9090ff; } +.muData { color: #ffff00; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } -.muScenario { color: #00af00; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## handling malformed programs</span> <span class="muData">container</span> programming-environment-data [ @@ -40,7 +32,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># copy code from recipe editor, persist, load into mu, save any errors</span> -<span class="muRecipe">recipe!</span> update-recipes env:address:shared:programming-environment-data, screen:address:shared:screen<span class="muRecipe"> -> </span>errors-found?:boolean, env:address:shared:programming-environment-data, screen:address:shared:screen [ +<span class="muRecipe">def!</span> update-recipes env:address:shared:programming-environment-data, screen:address:shared:screen<span class="muRecipe"> -> </span>errors-found?:boolean, env:address:shared:programming-environment-data, screen:address:shared:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> recipes:address:shared:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">recipes:offset</span> @@ -54,7 +46,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } status:address:shared:array:character<span class="Special"> <- </span>new <span class="Constant">[errors found ]</span> update-status screen, status, <span class="Constant">1/red</span> errors-found?<span class="Special"> <- </span>copy <span class="Constant">1/true</span> - <span class="muControl">reply</span> + <span class="muControl">return</span> <span class="Delimiter">}</span> errors-found?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> ] @@ -116,7 +108,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } errors:address:shared:array:character ] -<span class="muRecipe">recipe!</span> update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ +<span class="muRecipe">def!</span> update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number<span class="muRecipe"> -> </span>sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> data:address:shared:array:character<span class="Special"> <- </span>get *sandbox, <span class="Constant">data:offset</span> @@ -732,4 +724,3 @@ _, c:number<span class="Special"> <- </span>divide-with-remainder a, b </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> diff --git a/html/edit/011-editor-undo.mu.html b/html/edit/011-editor-undo.mu.html index d5d66d09..78005789 100644 --- a/html/edit/011-editor-undo.mu.html +++ b/html/edit/011-editor-undo.mu.html @@ -3,36 +3,28 @@ <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Mu - edit/011-editor-undo.mu</title> -<meta name="Generator" content="Vim/7.4"> -<meta name="plugin-version" content="vim7.4_v1"> +<meta name="Generator" content="Vim/7.3"> +<meta name="plugin-version" content="vim7.3_v6"> <meta name="syntax" content="none"> -<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy="> -<meta name="colorscheme" content="minimal"> +<meta name="settings" content="use_css"> <style type="text/css"> <!-- -pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } +pre { font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1.05em; } +.muScenario { color: #00af00; } .muControl { color: #c0a020; } -.muRecipe { color: #ff8700; } .Special { color: #ff6060; } +.Delimiter { color: #a04060; } +.Constant { color: #00a0a0; } +.muRecipe { color: #ff8700; } .muData { color: #ffff00; } .Comment { color: #9090ff; } -.Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } -.Delimiter { color: #a04060; } -.muScenario { color: #00af00; } --> </style> - -<script type='text/javascript'> -<!-- - ---> -</script> </head> <body> -<pre id='vimCodeElement'> +<pre> <span class="SalientComment">## undo/redo</span> <span class="Comment"># for every undoable event, create a type of *operation* that contains all the</span> @@ -107,7 +99,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } redo:address:address:shared:list:address:shared:operation<span class="Special"> <- </span>get-address *editor, <span class="Constant">redo:offset</span> *redo<span class="Special"> <- </span>push op, *redo <span class="Constant"> <handle-undo></span> - <span class="muControl">reply</span> screen/same-as-ingredient:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</span>, <span class="Constant">1/go-render</span> + <span class="muControl">return</span> screen/same-as-ingredient:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</span>, <span class="Constant">1/go-render</span> <span class="Delimiter">}</span> ] @@ -123,7 +115,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } undo:address:address:shared:list:address:shared:operation<span class="Special"> <- </span>get-address *editor, <span class="Constant">undo:offset</span> *undo<span class="Special"> <- </span>push op, *undo <span class="Constant"> <handle-redo></span> - <span class="muControl">reply</span> screen/same-as-ingredient:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</span>, <span class="Constant">1/go-render</span> + <span class="muControl">return</span> screen/same-as-ingredient:<span class="Constant">0</span>, editor/same-as-ingredient:<span class="Constant">1</span>, <span class="Constant">1/go-render</span> <span class="Delimiter">}</span> ] @@ -224,14 +216,14 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># redo stack, because it's now obsolete.</span> <span class="Comment"># Beware: since we're counting cursor moves as operations, this means just</span> <span class="Comment"># moving the cursor can lose work on the undo stack.</span> -<span class="muRecipe">recipe</span> add-operation editor:address:shared:editor-data, op:address:shared:operation<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ +<span class="muRecipe">def</span> add-operation editor:address:shared:editor-data, op:address:shared:operation<span class="muRecipe"> -> </span>editor:address:shared:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> undo:address:address:shared:list:address:shared:operation<span class="Special"> <- </span>get-address *editor, <span class="Constant">undo:offset</span> *undo<span class="Special"> <- </span>push op *undo redo:address:address:shared:list:address:shared:operation<span class="Special"> <- </span>get-address *editor, <span class="Constant">redo:offset</span> *redo<span class="Special"> <- </span>copy <span class="Constant">0</span> - <span class="muControl">reply</span> editor/same-as-ingredient:<span class="Constant">0</span> + <span class="muControl">return</span> editor/same-as-ingredient:<span class="Constant">0</span> ] <span class="muRecipe">after</span> <span class="Constant"><handle-undo></span> [ @@ -2108,4 +2100,3 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </pre> </body> </html> -<!-- vim: set foldmethod=manual : --> |