diff options
Diffstat (limited to 'edit')
-rw-r--r-- | edit/001-editor.mu | 36 | ||||
-rw-r--r-- | edit/002-typing.mu | 98 | ||||
-rw-r--r-- | edit/003-shortcuts.mu | 284 | ||||
-rw-r--r-- | edit/004-programming-environment.mu | 34 | ||||
-rw-r--r-- | edit/005-sandbox.mu | 74 | ||||
-rw-r--r-- | edit/006-sandbox-copy.mu | 20 | ||||
-rw-r--r-- | edit/007-sandbox-delete.mu | 30 | ||||
-rw-r--r-- | edit/008-sandbox-edit.mu | 32 | ||||
-rw-r--r-- | edit/009-sandbox-test.mu | 14 | ||||
-rw-r--r-- | edit/010-sandbox-trace.mu | 24 | ||||
-rw-r--r-- | edit/011-errors.mu | 108 | ||||
-rw-r--r-- | edit/012-editor-undo.mu | 116 |
12 files changed, 435 insertions, 435 deletions
diff --git a/edit/001-editor.mu b/edit/001-editor.mu index be210b95..f59c43e1 100644 --- a/edit/001-editor.mu +++ b/edit/001-editor.mu @@ -16,8 +16,8 @@ def! main text:address:array:character [ scenario editor-initially-prints-text-to-screen [ assume-screen 10/width, 5/height run [ - 1:address:array:character <- new [abc] - new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + new-editor 1:text, screen:address:screen, 0/left, 10/right ] screen-should-contain [ # top line of screen reserved for menu @@ -257,9 +257,9 @@ def clear-rest-of-screen screen:address:screen, row:number, left:number, right:n scenario editor-initially-prints-multiple-lines [ assume-screen 5/width, 5/height run [ - s:address:array:character <- new [abc + s:text <- new [abc def] - new-editor s:address:array:character, screen:address:screen, 0/left, 5/right + new-editor s:text, screen:address:screen, 0/left, 5/right ] screen-should-contain [ . . @@ -272,8 +272,8 @@ def] scenario editor-initially-handles-offsets [ assume-screen 5/width, 5/height run [ - s:address:array:character <- new [abc] - new-editor s:address:array:character, screen:address:screen, 1/left, 5/right + s:text <- new [abc] + new-editor s:text, screen:address:screen, 1/left, 5/right ] screen-should-contain [ . . @@ -285,9 +285,9 @@ scenario editor-initially-handles-offsets [ scenario editor-initially-prints-multiple-lines-at-offset [ assume-screen 5/width, 5/height run [ - s:address:array:character <- new [abc + s:text <- new [abc def] - new-editor s:address:array:character, screen:address:screen, 1/left, 5/right + new-editor s:text, screen:address:screen, 1/left, 5/right ] screen-should-contain [ . . @@ -300,8 +300,8 @@ def] scenario editor-initially-wraps-long-lines [ assume-screen 5/width, 5/height run [ - s:address:array:character <- new [abc def] - new-editor s:address:array:character, screen:address:screen, 0/left, 5/right + s:text <- new [abc def] + new-editor s:text, screen:address:screen, 0/left, 5/right ] screen-should-contain [ . . @@ -320,8 +320,8 @@ scenario editor-initially-wraps-long-lines [ scenario editor-initially-wraps-barely-long-lines [ assume-screen 5/width, 5/height run [ - s:address:array:character <- new [abcde] - new-editor s:address:array:character, screen:address:screen, 0/left, 5/right + s:text <- new [abcde] + new-editor s:text, screen:address:screen, 0/left, 5/right ] # still wrap, even though the line would fit. We need room to click on the # end of the line @@ -342,8 +342,8 @@ scenario editor-initially-wraps-barely-long-lines [ scenario editor-initializes-empty-text [ assume-screen 5/width, 5/height run [ - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right 3:number <- get *2:address:editor-data, cursor-row:offset 4:number <- get *2:address:editor-data, cursor-column:offset ] @@ -363,10 +363,10 @@ scenario editor-initializes-empty-text [ scenario render-colors-comments [ assume-screen 5/width, 5/height run [ - s:address:array:character <- new [abc + s:text <- new [abc # de f] - new-editor s:address:array:character, screen:address:screen, 0/left, 5/right + new-editor s:text, screen:address:screen, 0/left, 5/right ] screen-should-contain [ . . @@ -444,10 +444,10 @@ def get-color color:number, c:character -> color:number [ scenario render-colors-assignment [ assume-screen 8/width, 5/height run [ - s:address:array:character <- new [abc + s:text <- new [abc d <- e f] - new-editor s:address:array:character, screen:address:screen, 0/left, 8/right + new-editor s:text, screen:address:screen, 0/left, 8/right ] screen-should-contain [ . . diff --git a/edit/002-typing.mu b/edit/002-typing.mu index effdf5ae..f30e50ec 100644 --- a/edit/002-typing.mu +++ b/edit/002-typing.mu @@ -282,8 +282,8 @@ def editor-render screen:address:screen, editor:address:editor-data -> screen:ad scenario editor-handles-empty-event-queue [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [] run [ @@ -299,8 +299,8 @@ scenario editor-handles-empty-event-queue [ scenario editor-handles-mouse-clicks [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -326,8 +326,8 @@ scenario editor-handles-mouse-clicks [ scenario editor-handles-mouse-clicks-outside-text [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right $clear-trace assume-console [ left-click 1, 7 # last line, to the right of text @@ -346,9 +346,9 @@ scenario editor-handles-mouse-clicks-outside-text [ scenario editor-handles-mouse-clicks-outside-text-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right $clear-trace assume-console [ left-click 1, 7 # interior line, to the right of text @@ -367,9 +367,9 @@ def] scenario editor-handles-mouse-clicks-outside-text-3 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right $clear-trace assume-console [ left-click 3, 7 # below text @@ -388,9 +388,9 @@ def] scenario editor-handles-mouse-clicks-outside-column [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] + 1:text <- new [abc] # editor occupies only left half of screen - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -417,8 +417,8 @@ scenario editor-handles-mouse-clicks-outside-column [ scenario editor-handles-mouse-clicks-in-menu-area [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -439,8 +439,8 @@ scenario editor-handles-mouse-clicks-in-menu-area [ scenario editor-inserts-characters-into-empty-editor [ assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -460,8 +460,8 @@ scenario editor-inserts-characters-into-empty-editor [ scenario editor-inserts-characters-at-cursor [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # type two letters at different places @@ -484,8 +484,8 @@ scenario editor-inserts-characters-at-cursor [ scenario editor-inserts-characters-at-cursor-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -506,9 +506,9 @@ scenario editor-inserts-characters-at-cursor-2 [ scenario editor-inserts-characters-at-cursor-5 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -530,8 +530,8 @@ d] scenario editor-inserts-characters-at-cursor-3 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -552,9 +552,9 @@ scenario editor-inserts-characters-at-cursor-3 [ scenario editor-inserts-characters-at-cursor-4 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -576,9 +576,9 @@ d] scenario editor-inserts-characters-at-cursor-6 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -600,8 +600,8 @@ d] scenario editor-moves-cursor-after-inserting-characters [ assume-screen 10/width, 5/height - 1:address:array:character <- new [ab] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [ab] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data assume-console [ type [01] @@ -621,8 +621,8 @@ scenario editor-moves-cursor-after-inserting-characters [ scenario editor-wraps-line-on-insert [ assume-screen 5/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data # type a letter assume-console [ @@ -659,9 +659,9 @@ scenario editor-wraps-line-on-insert [ scenario editor-wraps-line-on-insert-2 [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abcdefg + 1:text <- new [abcdefg defg] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data # type more text at the start assume-console [ @@ -741,8 +741,8 @@ after <insert-character-special-case> [ scenario editor-wraps-cursor-after-inserting-characters-in-middle-of-line [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [abcde] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right assume-console [ left-click 1, 3 # right before the wrap icon type [f] @@ -769,7 +769,7 @@ scenario editor-wraps-cursor-after-inserting-characters-at-end-of-line [ local-scope assume-screen 10/width, 5/height # create an editor containing two lines - contents:address:array:character <- new [abc + contents:text <- new [abc xyz] 1:address:editor-data/raw <- new-editor contents, screen, 0/left, 5/right screen-should-contain [ @@ -796,8 +796,8 @@ xyz] scenario editor-wraps-cursor-to-left-margin [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 2/left, 7/right + 1:text <- new [abcde] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 2/left, 7/right assume-console [ left-click 1, 5 # line is full; no wrap icon yet type [01] @@ -832,8 +832,8 @@ after <editor-initialization> [ scenario editor-moves-cursor-down-after-inserting-newline [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right assume-console [ type [0 1] @@ -938,8 +938,8 @@ def line-indent curr:address:duplex-list:character, start:address:duplex-list:ch scenario editor-moves-cursor-down-after-inserting-newline-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 1/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 1/left, 10/right assume-console [ type [0 1] @@ -958,8 +958,8 @@ scenario editor-moves-cursor-down-after-inserting-newline-2 [ scenario editor-clears-previous-line-completely-after-inserting-newline [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [abcde] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right assume-console [ press enter ] @@ -985,10 +985,10 @@ scenario editor-clears-previous-line-completely-after-inserting-newline [ scenario editor-inserts-indent-after-newline [ assume-screen 10/width, 10/height - 1:address:array:character <- new [ab + 1:text <- new [ab cd ef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # position cursor after 'cd' and hit 'newline' assume-console [ left-click 2, 8 @@ -1009,10 +1009,10 @@ ef] scenario editor-skips-indent-around-paste [ assume-screen 10/width, 10/height - 1:address:array:character <- new [ab + 1:text <- new [ab cd ef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # position cursor after 'cd' and hit 'newline' surrounded by paste markers assume-console [ left-click 2, 8 diff --git a/edit/003-shortcuts.mu b/edit/003-shortcuts.mu index 40956cb3..0de84d48 100644 --- a/edit/003-shortcuts.mu +++ b/edit/003-shortcuts.mu @@ -7,9 +7,9 @@ scenario editor-inserts-two-spaces-on-tab [ assume-screen 10/width, 5/height # just one character in final line - 1:address:array:character <- new [ab + 1:text <- new [ab cd] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right assume-console [ press tab ] @@ -40,8 +40,8 @@ after <handle-special-character> [ scenario editor-handles-backspace-key [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -218,9 +218,9 @@ def previous-line-length curr:address:duplex-list:character, start:address:duple scenario editor-clears-last-line-on-backspace [ assume-screen 10/width, 5/height # just one character in final line - 1:address:array:character <- new [ab + 1:text <- new [ab cd] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right assume-console [ left-click 2, 0 # cursor at only character in final line press backspace @@ -245,9 +245,9 @@ cd] scenario editor-joins-and-wraps-lines-on-backspace [ assume-screen 10/width, 5/height # initialize editor with two long-ish but non-wrapping lines - 1:address:array:character <- new [abc def + 1:text <- new [abc def ghi jkl] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position the cursor at the start of the second and hit backspace @@ -271,8 +271,8 @@ ghi jkl] scenario editor-wraps-long-lines-on-backspace [ assume-screen 10/width, 5/height # initialize editor in part of the screen with a long line - 1:address:array:character <- new [abc def ghij] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 8/right + 1:text <- new [abc def ghij] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 8/right editor-render screen, 2:address:editor-data # confirm that it wraps screen-should-contain [ @@ -304,8 +304,8 @@ scenario editor-wraps-long-lines-on-backspace [ scenario editor-handles-delete-key [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -393,8 +393,8 @@ def delete-at-cursor editor:address:editor-data, screen:address:screen -> editor scenario editor-moves-cursor-right-with-key [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -490,9 +490,9 @@ def move-cursor-coordinates-right editor:address:editor-data, screen-height:numb scenario editor-moves-cursor-to-next-line-with-right-arrow [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # type right-arrow a few times to get to start of second line @@ -525,9 +525,9 @@ d] scenario editor-moves-cursor-to-next-line-with-right-arrow-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 1/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 1/left, 10/right editor-render screen, 2:address:editor-data assume-console [ press right-arrow @@ -550,8 +550,8 @@ d] scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abcdef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [abcdef] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -580,8 +580,8 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow [ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ assume-screen 10/width, 5/height # line just barely wrapping - 1:address:array:character <- new [abcde] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [abcde] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace # position cursor at last character before wrap and hit right-arrow @@ -616,8 +616,8 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-2 [ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-3 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abcdef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 1/left, 6/right + 1:text <- new [abcdef] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 1/left, 6/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -645,9 +645,9 @@ scenario editor-moves-cursor-to-next-wrapped-line-with-right-arrow-3 [ scenario editor-moves-cursor-to-next-line-with-right-arrow-at-end-of-line [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # move to end of line, press right-arrow, type a character @@ -676,8 +676,8 @@ d] scenario editor-moves-cursor-left-with-key [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -719,9 +719,9 @@ after <handle-special-key> [ scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line [ assume-screen 10/width, 5/height # initialize editor with two lines - 1:address:array:character <- new [abc + 1:text <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position cursor at start of second line (so there's no previous newline) @@ -744,10 +744,10 @@ d] scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-2 [ assume-screen 10/width, 5/height # initialize editor with three lines - 1:address:array:character <- new [abc + 1:text <- new [abc def g] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position cursor further down (so there's a newline before the character at @@ -772,10 +772,10 @@ g] scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-3 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def g] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position cursor at start of text, press left-arrow, then type a character @@ -801,10 +801,10 @@ g] scenario editor-moves-cursor-to-previous-line-with-left-arrow-at-start-of-line-4 [ assume-screen 10/width, 5/height # initialize editor with text containing an empty line - 1:address:array:character <- new [abc + 1:text <- new [abc d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # position cursor right after empty line @@ -829,8 +829,8 @@ d] scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [ assume-screen 10/width, 5/height # initialize editor with a wrapping line - 1:address:array:character <- new [abcdef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 1:text <- new [abcdef] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace screen-should-contain [ @@ -860,9 +860,9 @@ scenario editor-moves-across-screen-lines-across-wrap-with-left-arrow [ scenario editor-moves-across-screen-lines-to-wrapping-line-with-left-arrow [ assume-screen 10/width, 5/height # initialize editor with a wrapping line followed by a second line - 1:address:array:character <- new [abcdef + 1:text <- new [abcdef g] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace screen-should-contain [ @@ -892,9 +892,9 @@ g] scenario editor-moves-across-screen-lines-to-non-wrapping-line-with-left-arrow [ assume-screen 10/width, 5/height # initialize editor with a line on the verge of wrapping, followed by a second line - 1:address:array:character <- new [abcd + 1:text <- new [abcd e] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right editor-render screen, 2:address:editor-data $clear-trace screen-should-contain [ @@ -927,9 +927,9 @@ e] scenario editor-moves-to-previous-line-with-up-arrow [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -1043,9 +1043,9 @@ def move-to-previous-line editor:address:editor-data -> editor:address:editor-da scenario editor-adjusts-column-at-previous-line [ assume-screen 10/width, 5/height - 1:address:array:character <- new [ab + 1:text <- new [ab def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -1079,9 +1079,9 @@ def] scenario editor-adjusts-column-at-empty-line [ assume-screen 10/width, 5/height - 1:address:array:character <- new [ + 1:text <- new [ def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -1116,10 +1116,10 @@ def] scenario editor-moves-to-previous-line-from-left-margin [ assume-screen 10/width, 5/height # start out with three lines - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # click on the third line and hit up-arrow, so you end up just after a newline @@ -1156,9 +1156,9 @@ ghi] scenario editor-moves-to-next-line-with-down-arrow [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # cursor starts out at (1, 0) @@ -1261,9 +1261,9 @@ def move-to-next-line editor:address:editor-data, screen-height:number -> editor scenario editor-adjusts-column-at-next-line [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc de] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace assume-console [ @@ -1299,9 +1299,9 @@ de] scenario editor-moves-to-start-of-line-with-ctrl-a [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on second line, press ctrl-a @@ -1374,9 +1374,9 @@ def move-to-start-of-line editor:address:editor-data -> editor:address:editor-da scenario editor-moves-to-start-of-line-with-ctrl-a-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on first line (no newline before), press ctrl-a @@ -1399,9 +1399,9 @@ scenario editor-moves-to-start-of-line-with-ctrl-a-2 [ scenario editor-moves-to-start-of-line-with-home [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right $clear-trace # start on second line, press 'home' assume-console [ @@ -1423,9 +1423,9 @@ scenario editor-moves-to-start-of-line-with-home [ scenario editor-moves-to-start-of-line-with-home-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on first line (no newline before), press 'home' @@ -1450,9 +1450,9 @@ scenario editor-moves-to-start-of-line-with-home-2 [ scenario editor-moves-to-end-of-line-with-ctrl-e [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on first line, press ctrl-e @@ -1542,9 +1542,9 @@ def move-to-end-of-line editor:address:editor-data -> editor:address:editor-data scenario editor-moves-to-end-of-line-with-ctrl-e-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on second line (no newline after), press ctrl-e @@ -1567,9 +1567,9 @@ scenario editor-moves-to-end-of-line-with-ctrl-e-2 [ scenario editor-moves-to-end-of-line-with-end [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on first line, press 'end' @@ -1592,9 +1592,9 @@ scenario editor-moves-to-end-of-line-with-end [ scenario editor-moves-to-end-of-line-with-end-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # start on second line (no newline after), press 'end' @@ -1619,9 +1619,9 @@ scenario editor-moves-to-end-of-line-with-end-2 [ scenario editor-deletes-to-start-of-line-with-ctrl-u [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start on second line, press ctrl-u assume-console [ left-click 2, 2 @@ -1682,9 +1682,9 @@ def delete-to-start-of-line editor:address:editor-data -> result:address:duplex- scenario editor-deletes-to-start-of-line-with-ctrl-u-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start on first line (no newline before), press ctrl-u assume-console [ left-click 1, 2 @@ -1705,9 +1705,9 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u-2 [ scenario editor-deletes-to-start-of-line-with-ctrl-u-3 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start past end of line, press ctrl-u assume-console [ left-click 1, 3 @@ -1728,9 +1728,9 @@ scenario editor-deletes-to-start-of-line-with-ctrl-u-3 [ scenario editor-deletes-to-start-of-final-line-with-ctrl-u [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start past end of final line, press ctrl-u assume-console [ left-click 2, 3 @@ -1753,9 +1753,9 @@ scenario editor-deletes-to-start-of-final-line-with-ctrl-u [ scenario editor-deletes-to-end-of-line-with-ctrl-k [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start on first line, press ctrl-k assume-console [ left-click 1, 1 @@ -1808,9 +1808,9 @@ def delete-to-end-of-line editor:address:editor-data -> result:address:duplex-li scenario editor-deletes-to-end-of-line-with-ctrl-k-2 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start on second line (no newline after), press ctrl-k assume-console [ left-click 2, 1 @@ -1831,9 +1831,9 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-2 [ scenario editor-deletes-to-end-of-line-with-ctrl-k-3 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start at end of line assume-console [ left-click 1, 2 @@ -1854,9 +1854,9 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-3 [ scenario editor-deletes-to-end-of-line-with-ctrl-k-4 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start past end of line assume-console [ left-click 1, 3 @@ -1877,9 +1877,9 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-4 [ scenario editor-deletes-to-end-of-line-with-ctrl-k-5 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start at end of text assume-console [ left-click 2, 2 @@ -1900,9 +1900,9 @@ scenario editor-deletes-to-end-of-line-with-ctrl-k-5 [ scenario editor-deletes-to-end-of-line-with-ctrl-k-6 [ assume-screen 10/width, 5/height - 1:address:array:character <- new [123 + 1:text <- new [123 456] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right # start past end of text assume-console [ left-click 2, 3 @@ -1927,11 +1927,11 @@ scenario editor-can-scroll-down-using-arrow-keys [ # screen has 1 line for menu + 3 lines assume-screen 10/width, 4/height # initialize editor with >3 lines - 1:address:array:character <- new [a + 1:text <- new [a b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2005,11 +2005,11 @@ scenario editor-scrolls-down-past-wrapped-line-using-arrow-keys [ assume-screen 10/width, 4/height # initialize editor with a long, wrapped line and more than a screen of # other lines - 1:address:array:character <- new [abcdef + 1:text <- new [abcdef g h i] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right screen-should-contain [ . . .abcd↩ . @@ -2037,11 +2037,11 @@ scenario editor-scrolls-down-past-wrapped-line-using-arrow-keys-2 [ # screen has 1 line for menu + 3 lines assume-screen 10/width, 4/height # editor starts with a long line wrapping twice - 1:address:array:character <- new [abcdefghij + 1:text <- new [abcdefghij k l m] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right # position cursor at last line, then try to move further down assume-console [ left-click 3, 0 @@ -2077,10 +2077,10 @@ scenario editor-scrolls-down-when-line-wraps [ # screen has 1 line for menu + 3 lines assume-screen 5/width, 4/height # editor contains a long line in the third line - 1:address:array:character <- new [a + 1:text <- new [a b cdef] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right # position cursor at end, type a character assume-console [ left-click 3, 4 @@ -2107,10 +2107,10 @@ cdef] scenario editor-scrolls-down-on-newline [ assume-screen 5/width, 4/height # position cursor after last line and type newline - 1:address:array:character <- new [a + 1:text <- new [a b c] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right assume-console [ left-click 3, 4 type [ @@ -2138,10 +2138,10 @@ scenario editor-scrolls-down-on-right-arrow [ # screen has 1 line for menu + 3 lines assume-screen 5/width, 4/height # editor contains a wrapped line - 1:address:array:character <- new [a + 1:text <- new [a b cdefgh] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right # position cursor at end of screen and try to move right assume-console [ left-click 3, 3 @@ -2169,11 +2169,11 @@ scenario editor-scrolls-down-on-right-arrow-2 [ # screen has 1 line for menu + 3 lines assume-screen 5/width, 4/height # editor contains more lines than can fit on screen - 1:address:array:character <- new [a + 1:text <- new [a b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right # position cursor at end of screen and try to move right assume-console [ left-click 3, 3 @@ -2199,9 +2199,9 @@ d] scenario editor-scrolls-at-end-on-down-arrow [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc de] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data $clear-trace # try to move down past end of text @@ -2266,14 +2266,14 @@ scenario editor-combines-page-and-line-scroll [ # screen has 1 line for menu + 3 lines assume-screen 10/width, 4/height # initialize editor with a few pages of lines - 1:address:array:character <- new [a + 1:text <- new [a b c d e f g] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right # scroll down one page and one line assume-console [ press page-down @@ -2298,11 +2298,11 @@ scenario editor-can-scroll-up-using-arrow-keys [ # screen has 1 line for menu + 3 lines assume-screen 10/width, 4/height # initialize editor with >3 lines - 1:address:array:character <- new [a + 1:text <- new [a b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2386,11 +2386,11 @@ scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys [ assume-screen 10/width, 4/height # initialize editor with a long, wrapped line and more than a screen of # other lines - 1:address:array:character <- new [abcdef + 1:text <- new [abcdef g h i] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right screen-should-contain [ . . .abcd↩ . @@ -2430,11 +2430,11 @@ scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys-2 [ # screen has 1 line for menu + 4 lines assume-screen 10/width, 5/height # editor starts with a long line wrapping twice, occupying 3 of the 4 lines - 1:address:array:character <- new [abcdefghij + 1:text <- new [abcdefghij k l m] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right # position cursor at top of second page assume-console [ press page-down @@ -2503,11 +2503,11 @@ scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys-3 [ assume-screen 10/width, 4/height # initialize editor with a long, wrapped line and more than a screen of # other lines - 1:address:array:character <- new [abcdef + 1:text <- new [abcdef g h i] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 6/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 6/right screen-should-contain [ . . .abcde↩ . @@ -2547,13 +2547,13 @@ i] scenario editor-scrolls-up-past-wrapped-line-using-arrow-keys-4 [ assume-screen 10/width, 4/height # initialize editor with some lines around an empty line - 1:address:array:character <- new [a + 1:text <- new [a b c d e] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 6/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 6/right assume-console [ press page-down ] @@ -2596,12 +2596,12 @@ scenario editor-scrolls-up-on-left-arrow [ # screen has 1 line for menu + 3 lines assume-screen 5/width, 4/height # editor contains >3 lines - 1:address:array:character <- new [a + 1:text <- new [a b c d e] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right # position cursor at top of second page assume-console [ press page-down @@ -2641,11 +2641,11 @@ scenario editor-can-scroll-up-to-start-of-file [ # screen has 1 line for menu + 3 lines assume-screen 10/width, 4/height # initialize editor with >3 lines - 1:address:array:character <- new [a + 1:text <- new [a b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2689,11 +2689,11 @@ d] scenario editor-can-scroll [ assume-screen 10/width, 4/height - 1:address:array:character <- new [a + 1:text <- new [a b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2776,9 +2776,9 @@ def page-down editor:address:editor-data -> editor:address:editor-data [ scenario editor-does-not-scroll-past-end [ assume-screen 10/width, 4/height - 1:address:array:character <- new [a + 1:text <- new [a b] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data screen-should-contain [ . . @@ -2806,11 +2806,11 @@ scenario editor-starts-next-page-at-start-of-wrapped-line [ # screen has 1 line for menu + 3 lines for text assume-screen 10/width, 4/height # editor contains a long last line - 1:address:array:character <- new [a + 1:text <- new [a b cdefgh] # editor screen triggers wrap of last line - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 4/right # some part of last line is not displayed screen-should-contain [ . . @@ -2839,9 +2839,9 @@ scenario editor-starts-next-page-at-start-of-wrapped-line-2 [ assume-screen 10/width, 4/height # editor contains a very long line that occupies last two lines of screen # and still has something left over - 1:address:array:character <- new [a + 1:text <- new [a bcdefgh] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 4/right # some part of last line is not displayed screen-should-contain [ . . @@ -2869,11 +2869,11 @@ bcdefgh] scenario editor-can-scroll-up [ assume-screen 10/width, 4/height - 1:address:array:character <- new [a + 1:text <- new [a b c d] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -2965,7 +2965,7 @@ scenario editor-can-scroll-up-multiple-pages [ # screen has 1 line for menu + 3 lines assume-screen 10/width, 4/height # initialize editor with 8 lines - 1:address:array:character <- new [a + 1:text <- new [a b c d @@ -2973,7 +2973,7 @@ e f g h] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right screen-should-contain [ . . .a . @@ -3029,7 +3029,7 @@ scenario editor-can-scroll-up-wrapped-lines [ # screen has 1 line for menu + 5 lines for text assume-screen 10/width, 6/height # editor contains a long line in the first page - 1:address:array:character <- new [a + 1:text <- new [a b cdefgh i @@ -3040,7 +3040,7 @@ m n o] # editor screen triggers wrap of last line - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 4/right # some part of last line is not displayed screen-should-contain [ . . @@ -3091,9 +3091,9 @@ scenario editor-can-scroll-up-wrapped-lines-2 [ assume-screen 10/width, 4/height # editor contains a very long line that occupies last two lines of screen # and still has something left over - 1:address:array:character <- new [a + 1:text <- new [a bcdefgh] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 4/right # some part of last line is not displayed screen-should-contain [ . . @@ -3134,7 +3134,7 @@ bcdefgh] scenario editor-can-scroll-up-past-nonempty-lines [ assume-screen 10/width, 4/height # text with empty line in second screen - 1:address:array:character <- new [axx + 1:text <- new [axx bxx cxx dxx @@ -3143,7 +3143,7 @@ fxx gxx hxx ] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 4/right screen-should-contain [ . . .axx . @@ -3192,7 +3192,7 @@ hxx scenario editor-can-scroll-up-past-empty-lines [ assume-screen 10/width, 4/height # text with empty line in second screen - 1:address:array:character <- new [axy + 1:text <- new [axy bxy cxy @@ -3201,7 +3201,7 @@ exy fxy gxy ] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 4/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 4/right screen-should-contain [ . . .axy . diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu index e83aa642..261be52b 100644 --- a/edit/004-programming-environment.mu +++ b/edit/004-programming-environment.mu @@ -6,8 +6,8 @@ def! main [ local-scope open-console - initial-recipe:address:array:character <- restore [recipes.mu] - initial-sandbox:address:array:character <- new [] + initial-recipe:text <- restore [recipes.mu] + initial-sandbox:text <- new [] hide-screen 0/screen env:address:programming-environment-data <- new-programming-environment 0/screen, initial-recipe, initial-sandbox render-all 0/screen, env, render @@ -296,9 +296,9 @@ scenario point-at-multiple-editors [ trace-until 100/app # trace too long assume-screen 30/width, 5/height # initialize both halves of screen - 1:address:array:character <- new [abc] - 2:address:array:character <- new [def] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [abc] + 2:text <- new [def] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # focus on both sides assume-console [ left-click 1, 1 @@ -322,9 +322,9 @@ scenario edit-multiple-editors [ trace-until 100/app # trace too long assume-screen 30/width, 5/height # initialize both halves of screen - 1:address:array:character <- new [abc] - 2:address:array:character <- new [def] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [abc] + 2:text <- new [def] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # type one letter in each of them assume-console [ @@ -367,9 +367,9 @@ scenario multiple-editors-cover-only-their-own-areas [ trace-until 100/app # trace too long assume-screen 60/width, 10/height run [ - 1:address:array:character <- new [abc] - 2:address:array:character <- new [def] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [abc] + 2:text <- new [def] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render ] # divider isn't messed up @@ -385,9 +385,9 @@ scenario multiple-editors-cover-only-their-own-areas [ scenario editor-in-focus-keeps-cursor [ trace-until 100/app # trace too long assume-screen 30/width, 5/height - 1:address:array:character <- new [abc] - 2:address:array:character <- new [def] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [abc] + 2:text <- new [def] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # initialize programming environment and highlight cursor assume-console [] @@ -425,10 +425,10 @@ scenario backspace-in-sandbox-editor-joins-lines [ #? trace-until 100/app # trace too long assume-screen 30/width, 5/height # initialize sandbox side with two lines - 1:address:array:character <- new [] - 2:address:array:character <- new [abc + 1:text <- new [] + 2:text <- new [abc def] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render screen-should-contain [ . run (F4) . diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu index 1e203718..b49e342e 100644 --- a/edit/005-sandbox.mu +++ b/edit/005-sandbox.mu @@ -10,8 +10,8 @@ def! main [ local-scope open-console - initial-recipe:address:array:character <- restore [recipes.mu] - initial-sandbox:address:array:character <- new [] + initial-recipe:text <- restore [recipes.mu] + initial-sandbox:text <- new [] hide-screen 0/screen env:address:programming-environment-data <- new-programming-environment 0/screen, initial-recipe, initial-sandbox env <- restore-sandboxes env @@ -45,10 +45,10 @@ scenario run-and-show-results [ trace-until 100/app # trace too long assume-screen 100/width, 15/height # recipe editor is empty - 1:address:array:character <- new [] + 1:text <- new [] # sandbox editor contains an instruction without storing outputs - 2:address:array:character <- new [divide-with-remainder 11, 3] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [divide-with-remainder 11, 3] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run the code in the editors assume-console [ press F4 @@ -151,7 +151,7 @@ def run-sandboxes env:address:programming-environment-data, screen:address:scree <run-sandboxes-begin> current-sandbox:address:editor-data <- get *env, current-sandbox:offset { - sandbox-contents:address:array:character <- editor-contents current-sandbox + sandbox-contents:text <- editor-contents current-sandbox break-unless sandbox-contents # if contents exist, first save them # run them and turn them into a new sandbox-data @@ -191,7 +191,7 @@ def update-recipes env:address:programming-environment-data, screen:address:scre local-scope load-ingredients recipes:address:editor-data <- get *env, recipes:offset - in:address:array:character <- editor-contents recipes + in:text <- editor-contents recipes save [recipes.mu], in # newlayer: persistence reload in errors-found? <- copy 0/false @@ -201,8 +201,8 @@ def update-recipes env:address:programming-environment-data, screen:address:scre def! update-sandbox sandbox:address:sandbox-data, env:address:programming-environment-data, idx:number -> sandbox:address:sandbox-data, env:address:programming-environment-data [ local-scope load-ingredients - data:address:array:character <- get *sandbox, data:offset - response:address:array:character, _, fake-screen:address:screen <- run-sandboxed data + data:text <- get *sandbox, data:offset + response:text, _, fake-screen:address:screen <- run-sandboxed data *sandbox <- put *sandbox, response:offset, response *sandbox <- put *sandbox, screen:offset, fake-screen ] @@ -224,8 +224,8 @@ def save-sandboxes env:address:programming-environment-data [ idx:number <- copy 0 { break-unless curr - data:address:array:character <- get *curr, data:offset - filename:address:array:character <- to-text idx + data:text <- get *curr, data:offset + filename:text <- to-text idx save filename, data <end-save-sandbox> idx <- add idx, 1 @@ -277,11 +277,11 @@ def render-sandboxes screen:address:screen, sandbox:address:sandbox-data, left:n # render sandbox contents row <- add row, 1 screen <- move-cursor screen, row, left - sandbox-data:address:array:character <- get *sandbox, data:offset + sandbox-data:text <- get *sandbox, data:offset row, screen <- render-code screen, sandbox-data, left, right, row *sandbox <- put *sandbox, code-ending-row-on-screen:offset, row # render sandbox warnings, screen or response, in that order - sandbox-response:address:array:character <- get *sandbox, response:offset + sandbox-response:text <- get *sandbox, response:offset <render-sandbox-results> { sandbox-screen:address:screen <- get *sandbox, screen:offset @@ -424,8 +424,8 @@ def restore-sandboxes env:address:programming-environment-data -> env:address:pr curr:address:sandbox-data <- copy 0 prev:address:sandbox-data <- copy 0 { - filename:address:array:character <- to-text idx - contents:address:array:character <- restore filename + filename:text <- to-text idx + contents:text <- restore filename break-unless contents # stop at first error; assuming file didn't exist # todo: handle empty sandbox # create new sandbox for file @@ -519,15 +519,15 @@ scenario run-updates-results [ trace-until 100/app # trace too long assume-screen 100/width, 12/height # define a recipe (no indent for the 'add' line below so column numbers are more obvious) - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ local-scope z:number <- add 2, 2 reply z ]] # sandbox editor contains an instruction without storing outputs - 2:address:array:character <- new [foo] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run the code in the editors assume-console [ press F4 @@ -572,10 +572,10 @@ scenario run-instruction-manages-screen-per-sandbox [ trace-until 100/app # trace too long assume-screen 100/width, 20/height # left editor is empty - 1:address:array:character <- new [] + 1:text <- new [] # right editor contains an instruction - 2:address:array:character <- new [print-integer screen, 4] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [print-integer screen, 4] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run the code in the editor assume-console [ press F4 @@ -622,16 +622,16 @@ def editor-contents editor:address:editor-data -> result:address:array:character scenario editor-provides-edited-contents [ assume-screen 10/width, 5/height - 1:address:array:character <- new [abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right assume-console [ left-click 1, 2 type [def] ] run [ editor-event-loop screen:address:screen, console:address:console, 2:address:editor-data - 3:address:array:character <- editor-contents 2:address:editor-data - 4:array:character <- copy *3:address:array:character + 3:text <- editor-contents 2:address:editor-data + 4:array:character <- copy *3:text ] memory-should-contain [ 4:array:character <- [abdefc] @@ -798,9 +798,9 @@ scenario scrolling-down-past-bottom-of-sandbox-editor [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize sandbox side - 1:address:array:character <- new [] - 2:address:array:character <- new [add 2, 2] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [add 2, 2] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render assume-console [ # create a sandbox @@ -931,11 +931,11 @@ scenario scrolling-down-on-recipe-side [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize sandbox side and create a sandbox - 1:address:array:character <- new [ + 1:text <- new [ ] # create a sandbox - 2:address:array:character <- new [add 2, 2] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [add 2, 2] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render assume-console [ press F4 @@ -964,9 +964,9 @@ scenario scrolling-through-multiple-sandboxes [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize environment - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # create 2 sandboxes assume-console [ @@ -1116,9 +1116,9 @@ scenario scrolling-manages-sandbox-index-correctly [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize environment - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # create a sandbox assume-console [ diff --git a/edit/006-sandbox-copy.mu b/edit/006-sandbox-copy.mu index a5a98d4d..a08a1ec7 100644 --- a/edit/006-sandbox-copy.mu +++ b/edit/006-sandbox-copy.mu @@ -5,16 +5,16 @@ scenario copy-a-sandbox-to-editor [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ reply 4 ]] # run it - 2:address:array:character <- new [foo] + 2:text <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . @@ -67,16 +67,16 @@ scenario copy-a-sandbox-to-editor-2 [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ reply 4 ]] # run it - 2:address:array:character <- new [foo] + 2:text <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . @@ -167,7 +167,7 @@ def try-copy-sandbox click-row:number, env:address:programming-environment-data sandbox:address:sandbox-data <- find-sandbox env, click-row return-unless sandbox, 0/false clicked-on-copy-button? <- copy 1/true - text:address:array:character <- get *sandbox, data:offset + text:text <- get *sandbox, data:offset current-sandbox:address:editor-data <- get *env, current-sandbox:offset current-sandbox <- insert-text current-sandbox, text # reset scroll @@ -224,16 +224,16 @@ scenario copy-fails-if-sandbox-editor-not-empty [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ reply 4 ]] # run it - 2:address:array:character <- new [foo] + 2:text <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . diff --git a/edit/007-sandbox-delete.mu b/edit/007-sandbox-delete.mu index def5c0c5..3dac73f6 100644 --- a/edit/007-sandbox-delete.mu +++ b/edit/007-sandbox-delete.mu @@ -3,9 +3,9 @@ scenario deleting-sandboxes [ trace-until 100/app # trace too long assume-screen 100/width, 15/height - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run a few commands assume-console [ left-click 1, 80 @@ -151,9 +151,9 @@ scenario deleting-sandbox-after-scroll [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize environment - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # create 2 sandboxes and scroll to second assume-console [ @@ -197,9 +197,9 @@ scenario deleting-top-sandbox-after-scroll [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize environment - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # create 2 sandboxes and scroll to second assume-console [ @@ -243,9 +243,9 @@ scenario deleting-final-sandbox-after-scroll [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize environment - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # create 2 sandboxes and scroll to second assume-console [ @@ -291,9 +291,9 @@ scenario deleting-updates-sandbox-count [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize environment - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # create 2 sandboxes assume-console [ diff --git a/edit/008-sandbox-edit.mu b/edit/008-sandbox-edit.mu index b208c277..2b6a1179 100644 --- a/edit/008-sandbox-edit.mu +++ b/edit/008-sandbox-edit.mu @@ -4,16 +4,16 @@ scenario clicking-on-a-sandbox-moves-it-to-editor [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ reply 4 ]] # run it - 2:address:array:character <- new [foo] + 2:text <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . @@ -64,16 +64,16 @@ scenario clicking-on-a-sandbox-moves-it-to-editor-2 [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ reply 4 ]] # run it - 2:address:array:character <- new [foo] + 2:text <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . @@ -163,7 +163,7 @@ def try-edit-sandbox click-row:number, env:address:programming-environment-data return-unless sandbox, 0/false clicked-on-edit-button? <- copy 1/true # 'edit' button = 'copy' button + 'delete' button - text:address:array:character <- get *sandbox, data:offset + text:text <- get *sandbox, data:offset current-sandbox:address:editor-data <- get *env, current-sandbox:offset current-sandbox <- insert-text current-sandbox, text env <- delete-sandbox env, sandbox @@ -177,10 +177,10 @@ scenario sandbox-with-print-can-be-edited [ trace-until 100/app # trace too long assume-screen 100/width, 20/height # left editor is empty - 1:address:array:character <- new [] + 1:text <- new [] # right editor contains an instruction - 2:address:array:character <- new [print-integer screen, 4] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [print-integer screen, 4] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run the sandbox assume-console [ press F4 @@ -221,9 +221,9 @@ scenario editing-sandbox-after-scrolling-resets-scroll [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize environment - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # create 2 sandboxes and scroll to second assume-console [ @@ -269,9 +269,9 @@ scenario editing-sandbox-updates-sandbox-count [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # initialize environment - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text render-all screen, 3:address:programming-environment-data, render # create 2 sandboxes assume-console [ diff --git a/edit/009-sandbox-test.mu b/edit/009-sandbox-test.mu index 05738626..b02461a1 100644 --- a/edit/009-sandbox-test.mu +++ b/edit/009-sandbox-test.mu @@ -4,16 +4,16 @@ scenario sandbox-click-on-result-toggles-color-to-green [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ reply 4 ]] # run it - 2:address:array:character <- new [foo] + 2:text <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . @@ -93,7 +93,7 @@ container sandbox-data [ # include expected response when saving or restoring a sandbox before <end-save-sandbox> [ { - expected-response:address:array:character <- get *curr, expected-response:offset + expected-response:text <- get *curr, expected-response:offset break-unless expected-response filename <- append filename, [.out] save filename, expected-response @@ -167,7 +167,7 @@ def find-click-in-sandbox-output env:address:programming-environment-data, click def toggle-expected-response sandbox:address:sandbox-data -> sandbox:address:sandbox-data [ local-scope load-ingredients - expected-response:address:array:character <- get *sandbox, expected-response:offset + expected-response:text <- get *sandbox, expected-response:offset { # if expected-response is set, reset break-unless expected-response @@ -176,7 +176,7 @@ def toggle-expected-response sandbox:address:sandbox-data -> sandbox:address:san { # if not, set expected response to the current response break-if expected-response - response:address:array:character <- get *sandbox, response:offset + response:text <- get *sandbox, response:offset *sandbox <- put *sandbox, expected-response:offset, response } ] @@ -186,7 +186,7 @@ after <render-sandbox-response> [ { break-unless sandbox-response *sandbox <- put *sandbox, response-starting-row-on-screen:offset, row - expected-response:address:array:character <- get *sandbox, expected-response:offset + expected-response:text <- get *sandbox, expected-response:offset break-unless expected-response # fall-through to print in grey response-is-expected?:boolean <- equal expected-response, sandbox-response { diff --git a/edit/010-sandbox-trace.mu b/edit/010-sandbox-trace.mu index 38cf80af..8a860d31 100644 --- a/edit/010-sandbox-trace.mu +++ b/edit/010-sandbox-trace.mu @@ -4,16 +4,16 @@ scenario sandbox-click-on-code-toggles-app-trace [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ stash [abc] ]] # run it - 2:address:array:character <- new [foo] + 2:text <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . @@ -80,17 +80,17 @@ scenario sandbox-shows-app-trace-and-result [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # basic recipe - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ stash [abc] reply 4 ]] # run it - 2:address:array:character <- new [foo] + 2:text <- new [foo] assume-console [ press F4 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . @@ -127,14 +127,14 @@ recipe foo [ scenario clicking-on-app-trace-does-nothing [ trace-until 100/app # trace too long assume-screen 100/width, 10/height - 1:address:array:character <- new [] + 1:text <- new [] # create and expand the trace - 2:address:array:character <- new [stash 123456789] + 2:text <- new [stash 123456789] assume-console [ press F4 left-click 4, 51 ] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text event-loop screen:address:screen, console:address:console, 3:address:programming-environment-data screen-should-contain [ . run (F4) . @@ -177,8 +177,8 @@ container sandbox-data [ def! update-sandbox sandbox:address:sandbox-data, env:address:programming-environment-data, idx:number -> sandbox:address:sandbox-data, env:address:programming-environment-data [ local-scope load-ingredients - data:address:array:character <- get *sandbox, data:offset - response:address:array:character, _, fake-screen:address:screen, trace:address:array:character <- run-sandboxed data + data:text <- get *sandbox, data:offset + response:text, _, fake-screen:address:screen, trace:text <- run-sandboxed data *sandbox <- put *sandbox, response:offset, response *sandbox <- put *sandbox, screen:offset, fake-screen *sandbox <- put *sandbox, trace:offset, trace @@ -250,7 +250,7 @@ after <render-sandbox-results> [ { display-trace?:boolean <- get *sandbox, display-trace?:offset break-unless display-trace? - sandbox-trace:address:array:character <- get *sandbox, trace:offset + sandbox-trace:text <- get *sandbox, trace:offset break-unless sandbox-trace # nothing to print; move on row, screen <- render-text screen, sandbox-trace, left, right, 245/grey, row } diff --git a/edit/011-errors.mu b/edit/011-errors.mu index 774aedb1..6498d9a5 100644 --- a/edit/011-errors.mu +++ b/edit/011-errors.mu @@ -9,9 +9,9 @@ def! update-recipes env:address:programming-environment-data, screen:address:scr local-scope load-ingredients recipes:address:editor-data <- get *env, recipes:offset - in:address:array:character <- editor-contents recipes + in:text <- editor-contents recipes save [recipes.mu], in - recipe-errors:address:array:character <- reload in + recipe-errors:text <- reload in *env <- put *env, recipe-errors:offset, recipe-errors # if recipe editor has errors, stop { @@ -25,7 +25,7 @@ def! update-recipes env:address:programming-environment-data, screen:address:scr before <render-components-end> [ trace 11, [app], [render status] - recipe-errors:address:array:character <- get *env, recipe-errors:offset + recipe-errors:text <- get *env, recipe-errors:offset { break-unless recipe-errors update-status screen, [errors found ], 1/red @@ -34,7 +34,7 @@ before <render-components-end> [ before <render-recipe-components-end> [ { - recipe-errors:address:array:character <- get *env, recipe-errors:offset + recipe-errors:text <- get *env, recipe-errors:offset break-unless recipe-errors row, screen <- render-text screen, recipe-errors, left, right, 1/red, row } @@ -67,8 +67,8 @@ before <render-components-end> [ error-index:number <- get *env, error-index:offset sandboxes-completed-successfully?:boolean <- equal error-index, -1 break-if sandboxes-completed-successfully? - error-index-text:address:array:character <- to-text error-index - status:address:array:character <- interpolate [errors found (_) ], error-index-text + error-index-text:text <- to-text error-index + status:text <- interpolate [errors found (_) ], error-index-text update-status screen, status, 1/red } ] @@ -80,8 +80,8 @@ container sandbox-data [ def! update-sandbox sandbox:address:sandbox-data, env:address:programming-environment-data, idx:number -> sandbox:address:sandbox-data, env:address:programming-environment-data [ local-scope load-ingredients - data:address:array:character <- get *sandbox, data:offset - response:address:array:character, errors:address:array:character, fake-screen:address:screen, trace:address:array:character, completed?:boolean <- run-sandboxed data + data:text <- get *sandbox, data:offset + response:text, errors:text, fake-screen:address:screen, trace:text, completed?:boolean <- run-sandboxed data *sandbox <- put *sandbox, response:offset, response *sandbox <- put *sandbox, errors:offset, errors *sandbox <- put *sandbox, screen:offset, fake-screen @@ -105,7 +105,7 @@ def! update-sandbox sandbox:address:sandbox-data, env:address:programming-enviro # make sure we render any trace after <render-sandbox-trace-done> [ { - sandbox-errors:address:array:character <- get *sandbox, errors:offset + sandbox-errors:text <- get *sandbox, errors:offset break-unless sandbox-errors *sandbox <- put *sandbox, response-starting-row-on-screen:offset, 0 # no response row, screen <- render-text screen, sandbox-errors, left, right, 1/red, row @@ -117,12 +117,12 @@ after <render-sandbox-trace-done> [ scenario run-shows-errors-in-get [ trace-until 100/app # trace too long assume-screen 100/width, 15/height - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ get 123:number, foo:offset ]] - 2:address:array:character <- new [foo] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ press F4 ] @@ -157,9 +157,9 @@ recipe foo [ scenario run-updates-status-with-first-erroneous-sandbox [ trace-until 100/app # trace too long assume-screen 100/width, 15/height - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ left-click 3, 80 # create invalid sandbox 1 @@ -181,9 +181,9 @@ scenario run-updates-status-with-first-erroneous-sandbox [ scenario run-updates-status-with-first-erroneous-sandbox-2 [ trace-until 100/app # trace too long assume-screen 100/width, 15/height - 1:address:array:character <- new [] - 2:address:array:character <- new [] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ left-click 3, 80 # create invalid sandbox 2 @@ -208,9 +208,9 @@ scenario run-updates-status-with-first-erroneous-sandbox-2 [ scenario run-hides-errors-from-past-sandboxes [ trace-until 100/app # trace too long assume-screen 100/width, 15/height - 1:address:array:character <- new [] - 2:address:array:character <- new [get foo, x:offset] # invalid - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 1:text <- new [] + 2:text <- new [get foo, x:offset] # invalid + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ press F4 # generate error ] @@ -243,14 +243,14 @@ scenario run-updates-errors-for-shape-shifting-recipes [ trace-until 100/app # trace too long assume-screen 100/width, 15/height # define a shape-shifting recipe with an error - 1:address:array:character <- new [recipe foo x:_elem -> z:_elem [ + 1:text <- new [recipe foo x:_elem -> z:_elem [ local-scope load-ingredients y:address:number <- copy 0 z <- add x, y ]] - 2:address:array:character <- new [foo 2] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo 2] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ press F4 ] @@ -291,12 +291,12 @@ scenario run-avoids-spurious-errors-on-reloading-shape-shifting-recipes [ trace-until 100/app # trace too long assume-screen 100/width, 15/height # overload a well-known shape-shifting recipe - 1:address:array:character <- new [recipe length l:address:list:_elem -> n:number [ + 1:text <- new [recipe length l:address:list:_elem -> n:number [ ]] # call code that uses other variants of it, but not it itself - 2:address:array:character <- new [x:address:list:number <- copy 0 + 2:text <- new [x:address:list:number <- copy 0 to-text x] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run it once assume-console [ press F4 @@ -350,12 +350,12 @@ to-text x] scenario run-shows-missing-type-errors [ trace-until 100/app # trace too long assume-screen 100/width, 15/height - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ x <- copy 0 ]] - 2:address:array:character <- new [foo] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ press F4 ] @@ -376,12 +376,12 @@ scenario run-shows-unbalanced-bracket-errors [ trace-until 100/app # trace too long assume-screen 100/width, 15/height # recipe is incomplete (unbalanced '[') - 1:address:array:character <- new [ + 1:text <- new [ recipe foo \\[ x <- copy 0 ] - 2:address:array:character <- new [foo] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ press F4 ] @@ -403,14 +403,14 @@ recipe foo \\[ scenario run-shows-get-on-non-container-errors [ trace-until 100/app # trace too long assume-screen 100/width, 15/height - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ local-scope x:address:point <- new point:type get x:address:point, 1:offset ]] - 2:address:array:character <- new [foo] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ press F4 ] @@ -435,15 +435,15 @@ recipe foo [ scenario run-shows-non-literal-get-argument-errors [ trace-until 100/app # trace too long assume-screen 100/width, 15/height - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ local-scope x:number <- copy 0 y:address:point <- new point:type get *y:address:point, x:number ]] - 2:address:array:character <- new [foo] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ press F4 ] @@ -470,13 +470,13 @@ scenario run-shows-errors-everytime [ trace-until 100/app # trace too long # try to run a file with an error assume-screen 100/width, 15/height - 1:address:array:character <- new [ + 1:text <- new [ recipe foo [ local-scope x:number <- copy y:number ]] - 2:address:array:character <- new [foo] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text assume-console [ press F4 ] @@ -516,10 +516,10 @@ scenario run-instruction-and-print-errors [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # left editor is empty - 1:address:array:character <- new [] + 1:text <- new [] # right editor contains an illegal instruction - 2:address:array:character <- new [get 1234:number, foo:offset] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [get 1234:number, foo:offset] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run the code in the editors assume-console [ press F4 @@ -579,10 +579,10 @@ scenario run-instruction-and-print-errors-only-once [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # left editor is empty - 1:address:array:character <- new [] + 1:text <- new [] # right editor contains an illegal instruction - 2:address:array:character <- new [get 1234:number, foo:offset] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [get 1234:number, foo:offset] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run the code in the editors multiple times assume-console [ press F4 @@ -610,14 +610,14 @@ scenario sandbox-can-handle-infinite-loop [ trace-until 100/app # trace too long assume-screen 100/width, 20/height # left editor is empty - 1:address:array:character <- new [recipe foo [ + 1:text <- new [recipe foo [ { loop } ]] # right editor contains an instruction - 2:address:array:character <- new [foo] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run the sandbox assume-console [ press F4 @@ -641,7 +641,7 @@ scenario sandbox-with-errors-shows-trace [ trace-until 100/app # trace too long assume-screen 100/width, 10/height # generate a stash and a error - 1:address:array:character <- new [recipe foo [ + 1:text <- new [recipe foo [ local-scope a:number <- next-ingredient b:number <- next-ingredient @@ -649,8 +649,8 @@ stash [dividing by], b _, c:number <- divide-with-remainder a, b reply b ]] - 2:address:array:character <- new [foo 4, 0] - 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character + 2:text <- new [foo 4, 0] + 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:text, 2:text # run assume-console [ press F4 diff --git a/edit/012-editor-undo.mu b/edit/012-editor-undo.mu index 75872cf0..a245e77d 100644 --- a/edit/012-editor-undo.mu +++ b/edit/012-editor-undo.mu @@ -101,8 +101,8 @@ after <handle-special-character> [ scenario editor-can-undo-typing [ # create an editor and type a character assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [0] @@ -231,8 +231,8 @@ after <handle-undo> [ scenario editor-can-undo-typing-multiple [ # create an editor and type multiple characters assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [012] @@ -257,8 +257,8 @@ scenario editor-can-undo-typing-multiple [ scenario editor-can-undo-typing-multiple-2 [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [a] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [a] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # type some characters assume-console [ @@ -303,8 +303,8 @@ scenario editor-can-undo-typing-multiple-2 [ scenario editor-can-undo-typing-enter [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [ abc] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [ abc] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # new line assume-console [ @@ -366,8 +366,8 @@ scenario editor-can-undo-typing-enter [ scenario editor-redo-typing [ # create an editor, type something, undo assume-screen 10/width, 5/height - 1:address:array:character <- new [a] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [a] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [012] @@ -430,8 +430,8 @@ after <handle-redo> [ scenario editor-redo-typing-empty [ # create an editor, type something, undo assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [012] @@ -476,10 +476,10 @@ scenario editor-redo-typing-empty [ scenario editor-work-clears-redo-stack [ # create an editor with some text, do some work, undo assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [1] @@ -518,8 +518,8 @@ ghi] scenario editor-can-redo-typing-and-enter-and-tab [ # create an editor assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and tabs, hit enter, some more text and tabs assume-console [ @@ -675,10 +675,10 @@ scenario editor-can-redo-typing-and-enter-and-tab [ scenario editor-can-undo-touch [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ @@ -766,10 +766,10 @@ scenario editor-can-undo-scroll [ # screen has 1 line for menu + 3 lines assume-screen 5/width, 4/height # editor contains a wrapped line - 1:address:array:character <- new [a + 1:text <- new [a b cdefgh] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 5/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 5/right # position cursor at end of screen and try to move right assume-console [ left-click 3, 3 @@ -828,10 +828,10 @@ cdefgh] scenario editor-can-undo-left-arrow [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ @@ -872,10 +872,10 @@ ghi] scenario editor-can-undo-up-arrow [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ @@ -922,10 +922,10 @@ ghi] scenario editor-can-undo-down-arrow [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ @@ -966,13 +966,13 @@ ghi] scenario editor-can-undo-ctrl-f [ # create an editor with multiple pages of text assume-screen 10/width, 5/height - 1:address:array:character <- new [a + 1:text <- new [a b c d e f] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # scroll the page assume-console [ @@ -1001,13 +1001,13 @@ f] scenario editor-can-undo-page-down [ # create an editor with multiple pages of text assume-screen 10/width, 5/height - 1:address:array:character <- new [a + 1:text <- new [a b c d e f] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # scroll the page assume-console [ @@ -1036,13 +1036,13 @@ f] scenario editor-can-undo-ctrl-b [ # create an editor with multiple pages of text assume-screen 10/width, 5/height - 1:address:array:character <- new [a + 1:text <- new [a b c d e f] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # scroll the page down and up assume-console [ @@ -1072,13 +1072,13 @@ f] scenario editor-can-undo-page-up [ # create an editor with multiple pages of text assume-screen 10/width, 5/height - 1:address:array:character <- new [a + 1:text <- new [a b c d e f] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # scroll the page down and up assume-console [ @@ -1108,10 +1108,10 @@ f] scenario editor-can-undo-ctrl-a [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor, then to start of line assume-console [ @@ -1152,10 +1152,10 @@ ghi] scenario editor-can-undo-home [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor, then to start of line assume-console [ @@ -1196,10 +1196,10 @@ ghi] scenario editor-can-undo-ctrl-e [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor, then to start of line assume-console [ @@ -1240,10 +1240,10 @@ ghi] scenario editor-can-undo-end [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor, then to start of line assume-console [ @@ -1284,10 +1284,10 @@ ghi] scenario editor-can-undo-multiple-arrows-in-the-same-direction [ # create an editor with some text assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # move the cursor assume-console [ @@ -1338,10 +1338,10 @@ ghi] scenario editor-redo-touch [ # create an editor with some text, click on a character, undo assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def ghi] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ left-click 3, 1 @@ -1395,8 +1395,8 @@ after <handle-redo> [ scenario editor-separates-undo-insert-from-undo-cursor-move [ # create an editor, type some text, move the cursor, type some more text assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data assume-console [ type [abc] @@ -1544,8 +1544,8 @@ scenario editor-separates-undo-insert-from-undo-cursor-move [ scenario editor-can-undo-and-redo-backspace [ # create an editor assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit backspace assume-console [ @@ -1689,8 +1689,8 @@ after <handle-redo> [ scenario editor-can-undo-and-redo-delete [ # create an editor assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit delete and backspace a few times assume-console [ @@ -1878,9 +1878,9 @@ before <delete-character-end> [ scenario editor-can-undo-and-redo-ctrl-k [ # create an editor assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit delete and backspace a few times assume-console [ @@ -1980,9 +1980,9 @@ before <delete-to-end-of-line-end> [ scenario editor-can-undo-and-redo-ctrl-u [ # create an editor assume-screen 10/width, 5/height - 1:address:array:character <- new [abc + 1:text <- new [abc def] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit delete and backspace a few times assume-console [ @@ -2081,8 +2081,8 @@ before <delete-to-start-of-line-end> [ scenario editor-can-undo-and-redo-ctrl-u-2 [ # create an editor assume-screen 10/width, 5/height - 1:address:array:character <- new [] - 2:address:editor-data <- new-editor 1:address:array:character, screen:address:screen, 0/left, 10/right + 1:text <- new [] + 2:address:editor-data <- new-editor 1:text, screen:address:screen, 0/left, 10/right editor-render screen, 2:address:editor-data # insert some text and hit delete and backspace a few times assume-console [ |