diff options
Diffstat (limited to 'html/edit')
-rw-r--r-- | html/edit/001-editor.mu.html | 2 | ||||
-rw-r--r-- | html/edit/002-typing.mu.html | 8 | ||||
-rw-r--r-- | html/edit/003-shortcuts.mu.html | 14 | ||||
-rw-r--r-- | html/edit/004-programming-environment.mu.html | 10 | ||||
-rw-r--r-- | html/edit/005-sandbox.mu.html | 6 | ||||
-rw-r--r-- | html/edit/006-sandbox-edit.mu.html | 2 | ||||
-rw-r--r-- | html/edit/007-sandbox-delete.mu.html | 2 | ||||
-rw-r--r-- | html/edit/010-warnings.mu.html | 62 |
8 files changed, 87 insertions, 19 deletions
diff --git a/html/edit/001-editor.mu.html b/html/edit/001-editor.mu.html index 59982193..11d1cb9d 100644 --- a/html/edit/001-editor.mu.html +++ b/html/edit/001-editor.mu.html @@ -287,7 +287,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muControl">reply</span> screen/same-as-ingredient:<span class="Constant">0</span> ] -<span class="muRecipe">recipe</span> clear-rest-of-screen screen:address:screen, row:number, left:number, right:number [ +<span class="muRecipe">recipe</span> clear-rest-of-screen screen:address:screen, row:number, left:number, right:number<span class="muRecipe"> -> </span>screen:address: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> diff --git a/html/edit/002-typing.mu.html b/html/edit/002-typing.mu.html index efed71b6..2585450c 100644 --- a/html/edit/002-typing.mu.html +++ b/html/edit/002-typing.mu.html @@ -46,7 +46,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } close-console ] -<span class="muRecipe">recipe</span> editor-event-loop screen:address:screen, console:address:console, editor:address:editor-data [ +<span class="muRecipe">recipe</span> editor-event-loop screen:address:screen, console:address:console, editor:address:editor-data<span class="muRecipe"> -> </span>screen:address:screen, console:address:console, editor:address:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Delimiter">{</span> @@ -80,7 +80,7 @@ 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:screen, editor:address:editor-data, t:touch-event<span class="muRecipe"> -> </span>in-focus?:boolean [ +<span class="muRecipe">recipe</span> move-cursor-in-editor screen:address:screen, editor:address:editor-data, t:touch-event<span class="muRecipe"> -> </span>in-focus?:boolean, editor:address: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> @@ -294,7 +294,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># helper for tests</span> -<span class="muRecipe">recipe</span> editor-render screen:address:screen, editor:address:editor-data<span class="muRecipe"> -> </span>screen:address:screen [ +<span class="muRecipe">recipe</span> editor-render screen:address:screen, editor:address:editor-data<span class="muRecipe"> -> </span>screen:address:screen, editor:address: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> @@ -1047,7 +1047,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="SalientComment">## helpers</span> -<span class="muRecipe">recipe</span> draw-horizontal screen:address:screen, row:number, x:number, right:number [ +<span class="muRecipe">recipe</span> draw-horizontal screen:address:screen, row:number, x:number, right:number<span class="muRecipe"> -> </span>screen:address: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> diff --git a/html/edit/003-shortcuts.mu.html b/html/edit/003-shortcuts.mu.html index 5518a680..0f7a60da 100644 --- a/html/edit/003-shortcuts.mu.html +++ b/html/edit/003-shortcuts.mu.html @@ -118,6 +118,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> + data:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> <span class="Comment"># if at start of text (before-cursor at § sentinel), return</span> prev:address: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> @@ -126,7 +127,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } 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 backspaced-cell:address:duplex-list:character<span class="Special"> <- </span>copy *before-cursor - remove *before-cursor <span class="Comment"># will also neatly trim next/prev pointers in backspaced-cell/*before-cursor</span> + 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? @@ -367,11 +368,12 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> + data:address:duplex-list:character<span class="Special"> <- </span>get *editor, <span class="Constant">data:offset</span> deleted-cell:address: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 currc:character<span class="Special"> <- </span>get *deleted-cell, <span class="Constant">value:offset</span> - remove deleted-cell + 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? @@ -1278,7 +1280,7 @@ def] <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> move-to-start-of-line editor:address:editor-data [ +<span class="muRecipe">recipe</span> move-to-start-of-line editor:address:editor-data<span class="muRecipe"> -> </span>editor:address:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># update cursor column</span> @@ -1449,7 +1451,7 @@ def] <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> move-to-end-of-line editor:address:editor-data [ +<span class="muRecipe">recipe</span> move-to-end-of-line editor:address:editor-data<span class="muRecipe"> -> </span>editor:address:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> before-cursor:address:address:duplex-list:character<span class="Special"> <- </span>get-address *editor, <span class="Constant">before-cursor:offset</span> @@ -1579,7 +1581,7 @@ def] <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> delete-to-start-of-line editor:address:editor-data<span class="muRecipe"> -> </span>result:address:duplex-list:character [ +<span class="muRecipe">recipe</span> delete-to-start-of-line editor:address:editor-data<span class="muRecipe"> -> </span>result:address:duplex-list:character, editor:address:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># compute range to delete</span> @@ -1713,7 +1715,7 @@ def] <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> delete-to-end-of-line editor:address:editor-data<span class="muRecipe"> -> </span>result:address:duplex-list:character [ +<span class="muRecipe">recipe</span> delete-to-end-of-line editor:address:editor-data<span class="muRecipe"> -> </span>result:address:duplex-list:character, editor:address:editor-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># compute range to delete</span> diff --git a/html/edit/004-programming-environment.mu.html b/html/edit/004-programming-environment.mu.html index a2001520..7b632086 100644 --- a/html/edit/004-programming-environment.mu.html +++ b/html/edit/004-programming-environment.mu.html @@ -56,7 +56,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:screen, initial-recipe-contents:address:array:character, initial-sandbox-contents:address:array:character<span class="muRecipe"> -> </span>result:address:programming-environment-data [ +<span class="muRecipe">recipe</span> new-programming-environment screen:address:screen, initial-recipe-contents:address:array:character, initial-sandbox-contents:address:array:character<span class="muRecipe"> -> </span>result:address:programming-environment-data, screen:address:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> width:number<span class="Special"> <- </span>screen-width screen @@ -82,7 +82,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } *current-sandbox<span class="Special"> <- </span>new-editor initial-sandbox-contents, screen, new-left, width/right ] -<span class="muRecipe">recipe</span> event-loop screen:address:screen, console:address:console, env:address:programming-environment-data [ +<span class="muRecipe">recipe</span> event-loop screen:address:screen, console:address:console, env:address:programming-environment-data<span class="muRecipe"> -> </span>screen:address:screen, console:address:console, env:address:programming-environment-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> recipes:address:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">recipes:offset</span> @@ -141,7 +141,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> <span class="Delimiter">{</span> <span class="muControl">break-if</span> more-events? - env<span class="Special"> <- </span>resize screen, env + env, screen<span class="Special"> <- </span>resize screen, env screen<span class="Special"> <- </span>render-all screen, env render-all-on-no-more-events?<span class="Special"> <- </span>copy <span class="Constant">0/false</span> <span class="Comment"># full render done</span> <span class="Delimiter">}</span> @@ -214,7 +214,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">}</span> ] -<span class="muRecipe">recipe</span> resize screen:address:screen, env:address:programming-environment-data<span class="muRecipe"> -> </span>env:address:programming-environment-data [ +<span class="muRecipe">recipe</span> resize screen:address:screen, env:address:programming-environment-data<span class="muRecipe"> -> </span>env:address:programming-environment-data, screen:address:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> clear-screen screen <span class="Comment"># update screen dimensions</span> @@ -633,7 +633,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="SalientComment">## helpers</span> -<span class="muRecipe">recipe</span> draw-vertical screen:address:screen, col:number, y:number, bottom:number [ +<span class="muRecipe">recipe</span> draw-vertical screen:address:screen, col:number, y:number, bottom:number<span class="muRecipe"> -> </span>screen:address: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> diff --git a/html/edit/005-sandbox.mu.html b/html/edit/005-sandbox.mu.html index 9c219526..0b3e3926 100644 --- a/html/edit/005-sandbox.mu.html +++ b/html/edit/005-sandbox.mu.html @@ -20,6 +20,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } .Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } +.CommentedCode { color: #6c6c6c; } .Delimiter { color: #a04060; } .muScenario { color: #00af00; } --> @@ -149,6 +150,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">{</span> do-run?:boolean<span class="Special"> <- </span>equal *k, <span class="Constant">65532/F4</span> <span class="muControl">break-unless</span> do-run? +<span class="CommentedCode">#? $log [F4 pressed]</span> status:address:array:character<span class="Special"> <- </span>new <span class="Constant">[running... ]</span> screen<span class="Special"> <- </span>update-status screen, status, <span class="Constant">245/grey</span> error?:boolean, env, screen<span class="Special"> <- </span>run-sandboxes env, screen @@ -261,6 +263,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muRecipe">recipe!</span> render-sandbox-side screen:address:screen, env:address:programming-environment-data<span class="muRecipe"> -> </span>screen:address:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> +<span class="CommentedCode">#? $log [render sandbox side]</span> trace <span class="Constant">11</span>, <span class="Constant">[app]</span>, <span class="Constant">[render sandbox side]</span> current-sandbox:address:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">current-sandbox:offset</span> left:number<span class="Special"> <- </span>get *current-sandbox, <span class="Constant">left:offset</span> @@ -274,9 +277,10 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } clear-rest-of-screen screen, row, left, left, right ] -<span class="muRecipe">recipe</span> render-sandboxes screen:address:screen, sandbox:address:sandbox-data, left:number, right:number, row:number<span class="muRecipe"> -> </span>row:number, screen:address:screen [ +<span class="muRecipe">recipe</span> render-sandboxes screen:address:screen, sandbox:address:sandbox-data, left:number, right:number, row:number<span class="muRecipe"> -> </span>row:number, screen:address:screen, sandbox:address:sandbox-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> +<span class="CommentedCode">#? $log [render sandbox]</span> <span class="muControl">reply-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 diff --git a/html/edit/006-sandbox-edit.mu.html b/html/edit/006-sandbox-edit.mu.html index 2381ec45..d902c4b7 100644 --- a/html/edit/006-sandbox-edit.mu.html +++ b/html/edit/006-sandbox-edit.mu.html @@ -131,7 +131,7 @@ 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:programming-environment-data, click-row:number<span class="muRecipe"> -> </span>result:address:sandbox-data [ +<span class="muRecipe">recipe</span> extract-sandbox env:address:programming-environment-data, click-row:number<span class="muRecipe"> -> </span>result:address:sandbox-data, env:address:programming-environment-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> diff --git a/html/edit/007-sandbox-delete.mu.html b/html/edit/007-sandbox-delete.mu.html index f563b266..6d289afa 100644 --- a/html/edit/007-sandbox-delete.mu.html +++ b/html/edit/007-sandbox-delete.mu.html @@ -111,7 +111,7 @@ 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:programming-environment-data<span class="muRecipe"> -> </span>was-delete?:boolean [ +<span class="muRecipe">recipe</span> delete-sandbox t:touch-event, env:address:programming-environment-data<span class="muRecipe"> -> </span>was-delete?:boolean, env:address: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> diff --git a/html/edit/010-warnings.mu.html b/html/edit/010-warnings.mu.html index 6d746bf5..c675b386 100644 --- a/html/edit/010-warnings.mu.html +++ b/html/edit/010-warnings.mu.html @@ -44,6 +44,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muRecipe">recipe!</span> update-recipes env:address:programming-environment-data, screen:address:screen<span class="muRecipe"> -> </span>errors-found?:boolean, env:address:programming-environment-data, screen:address:screen [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> +<span class="CommentedCode">#? $log [update recipes]</span> recipes:address:editor-data<span class="Special"> <- </span>get *env, <span class="Constant">recipes:offset</span> in:address:array:character<span class="Special"> <- </span>editor-contents recipes save <span class="Constant">[recipes.mu]</span>, in @@ -85,6 +86,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muRecipe">recipe!</span> update-sandbox sandbox:address:sandbox-data<span class="muRecipe"> -> </span>sandbox:address:sandbox-data [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> +<span class="CommentedCode">#? $log [update sandbox]</span> data:address:array:character<span class="Special"> <- </span>get *sandbox, <span class="Constant">data:offset</span> response:address:address:array:character<span class="Special"> <- </span>get-address *sandbox, <span class="Constant">response:offset</span> warnings:address:address:array:character<span class="Special"> <- </span>get-address *sandbox, <span class="Constant">warnings:offset</span> @@ -235,6 +237,66 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] ] +<span class="muScenario">scenario</span> run-avoids-spurious-warnings-on-reloading-shape-shifting-recipes [ + trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> + assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span> + <span class="Comment"># overload a well-known shape-shifting recipe</span> + <span class="Constant">1</span>:address:array:character<span class="Special"> <- </span>new <span class="Constant">[recipe length l:address:list:_elem -> n:number [</span> +<span class="Constant">]</span>] + <span class="Comment"># call code that uses other variants of it, but not it itself</span> + <span class="Constant">2</span>:address:array:character<span class="Special"> <- </span>new <span class="Constant">[x:address:list:number <- copy 0</span> +<span class="Constant">to-text x]</span> + <span class="Constant">3</span>:address:programming-environment-data<span class="Special"> <- </span>new-programming-environment screen:address:screen, <span class="Constant">1</span>:address:array:character, <span class="Constant">2</span>:address:array:character + <span class="Comment"># run it once</span> + assume-console [ + press F4 + ] + event-loop screen:address:screen, console:address:console, <span class="Constant">3</span>:address:programming-environment-data + <span class="Comment"># no errors anywhere on screen (can't check anything else, since to-text will return an address)</span> + screen-should-contain-in-color <span class="Constant">1/red</span>, [ + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . <- .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + ] + <span class="Comment"># rerun everything</span> + assume-console [ + press F4 + ] + run [ + event-loop screen:address:screen, console:address:console, <span class="Constant">3</span>:address:programming-environment-data + ] + <span class="Comment"># still no errors</span> + screen-should-contain-in-color <span class="Constant">1/red</span>, [ + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . <- .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + <span class="Constant"> . .</span> + ] +] + <span class="muScenario">scenario</span> run-shows-missing-type-warnings [ trace-until <span class="Constant">100/app</span> <span class="Comment"># trace too long</span> assume-screen <span class="Constant">100/width</span>, <span class="Constant">15/height</span> |