From 0dda332ce36f751b8431fd30cbf7f42501e85800 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 12 Jun 2021 21:11:22 -0700 Subject: . Roll back to commit 70919b45f0. Recent commits add lots of extra function args for dubious benefit. --- 500fake-screen.mu | 30 +---------- hest-life.mu | 2 +- shell/environment.mu | 70 ++++++++++++------------ shell/evaluate.mu | 76 +++++++++++++------------- shell/global.mu | 4 +- shell/macroexpand.mu | 12 ++--- shell/main.mu | 2 +- shell/primitives.mu | 2 +- shell/sandbox.mu | 150 +++++++++++++++++++-------------------------------- 9 files changed, 140 insertions(+), 208 deletions(-) diff --git a/500fake-screen.mu b/500fake-screen.mu index 88c5399a..641a8d4b 100644 --- a/500fake-screen.mu +++ b/500fake-screen.mu @@ -545,36 +545,8 @@ fn pixel-index _screen: (addr screen), x: int, y: int -> _/ecx: int { # double-buffering primitive # 'screen' must be a fake screen. 'target-screen' is usually real. # Both screens must have the same size. -fn copy-screen _screen: (addr screen), target-screen: (addr screen) { +fn copy-pixels _screen: (addr screen), target-screen: (addr screen) { var screen/esi: (addr screen) <- copy _screen - # copy graphemes - var width-a/edi: (addr int) <- get screen, width - var height-a/ebx: (addr int) <- get screen, height - var y/edx: int <- copy 0 - { - compare y, *height-a - break-if->= - var x/ecx: int <- copy 0 - { - compare x, *width-a - break-if->= - var g: grapheme - var tmp/eax: grapheme <- screen-grapheme-at screen, x, y - copy-to g, tmp - var fg: int - var tmp/eax: int <- screen-color-at screen, x, y - copy-to fg, tmp - var bg: int - tmp <- screen-background-color-at screen, x, y - copy-to bg, tmp - draw-grapheme target-screen, g, x, y, fg, bg - x <- increment - loop - } - y <- increment - loop - } - # copy pixels var pixels-ah/eax: (addr handle array byte) <- get screen, pixels var _pixels/eax: (addr array byte) <- lookup *pixels-ah var pixels/edi: (addr array byte) <- copy _pixels diff --git a/hest-life.mu b/hest-life.mu index 1ca5923f..e2e4ca64 100644 --- a/hest-life.mu +++ b/hest-life.mu @@ -28,7 +28,7 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) var second-screen/edi: (addr screen) <- address second-buffer initialize-screen second-screen, 0x80, 0x30, 1/include-pixels render second-screen, env - copy-screen second-screen, screen + copy-pixels second-screen, screen { edit keyboard, env var play?/eax: (addr boolean) <- get env, play? diff --git a/shell/environment.mu b/shell/environment.mu index d9d0c9d0..516c545d 100644 --- a/shell/environment.mu +++ b/shell/environment.mu @@ -28,7 +28,7 @@ fn test-environment { # type some code into sandbox type-in env, screen, "(+ 3 4)" # we don't have any global definitions here, so no macros # run code in sandbox - edit-environment env, 0x13/ctrl-s, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x13/ctrl-s, 0/no-disk render-environment screen, env # | global definitions | sandbox # top row blank for now @@ -62,7 +62,7 @@ fn test-definition-in-environment { initialize-screen screen, 0x80/width=72, 0x10/height, 0/no-pixel-graphics # define a global on the right (sandbox) side type-in env, screen, "(define f 42)" - edit-environment env, 0x13/ctrl-s, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x13/ctrl-s, 0/no-disk render-environment screen, env # | global definitions | sandbox check-screen-row screen, 0/y, " ", "F - test-definition-in-environment/0" @@ -83,7 +83,7 @@ fn test-definition-in-environment { # helper for testing fn type-in self: (addr environment), screen: (addr screen), keys: (addr array byte) { # clear the buffer - edit-environment self, 0x15/ctrl-u, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment self, 0x15/ctrl-u, 0/no-disk render-environment screen, self # type in all the keys var input-stream-storage: (stream byte 0x40/capacity) @@ -94,7 +94,7 @@ fn type-in self: (addr environment), screen: (addr screen), keys: (addr array by compare done?, 0/false break-if-!= var key/eax: grapheme <- read-grapheme input-stream - edit-environment self, key, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment self, key, 0/no-disk render-environment screen, self loop } @@ -145,7 +145,7 @@ fn render-environment screen: (addr screen), _self: (addr environment) { render-sandbox-menu screen, sandbox } -fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr disk), outer-screen: (addr screen), outer-keyboard: (addr keyboard) { +fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr disk) { var self/esi: (addr environment) <- copy _self var globals/edi: (addr global-table) <- get self, globals var sandbox/ecx: (addr sandbox) <- get self, sandbox @@ -189,7 +189,7 @@ fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr d var trace-storage: trace var trace/ebx: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate tmp, out-ah, nil, globals, trace, 0/no-fake-screen, 0/no-fake-keyboard, 0/definitions-created, 0/no-outer-screen, 0/no-outer-keyboard, 0/call-number + evaluate tmp, out-ah, nil, globals, trace, 0/no-fake-screen, 0/no-fake-keyboard, 0/definitions-created, 0/call-number # wait for a keypress { var tmp/eax: byte <- read-key 0/keyboard @@ -216,7 +216,7 @@ fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr d edit-globals globals, key } # update sandbox whether the cursor is in globals or sandbox - edit-sandbox sandbox, key, globals, data-disk, outer-screen, outer-keyboard + edit-sandbox sandbox, key, globals, data-disk } return } @@ -366,10 +366,10 @@ fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr d edit-globals globals, key return } - edit-sandbox sandbox, key, globals, data-disk, outer-screen, outer-keyboard + edit-sandbox sandbox, key, globals, data-disk } -fn read-and-evaluate-and-save-gap-buffer-to-globals _in-ah: (addr handle gap-buffer), result-ah: (addr handle cell), globals: (addr global-table), definitions-created: (addr stream int), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), outer-screen: (addr screen), outer-keyboard: (addr keyboard) { +fn read-and-evaluate-and-save-gap-buffer-to-globals _in-ah: (addr handle gap-buffer), result-ah: (addr handle cell), globals: (addr global-table), definitions-created: (addr stream int), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell) { var in-ah/eax: (addr handle gap-buffer) <- copy _in-ah var in/eax: (addr gap-buffer) <- lookup *in-ah var read-result-h: (handle cell) @@ -394,7 +394,7 @@ fn read-and-evaluate-and-save-gap-buffer-to-globals _in-ah: (addr handle gap-buf #? set-cursor-position 0/screen, 0 0 #? turn-on-debug-print debug-print "^", 4/fg, 0/bg - evaluate read-result-ah, result-ah, *nil-ah, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, 1/call-number + evaluate read-result-ah, result-ah, *nil-ah, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, 1/call-number debug-print "$", 4/fg, 0/bg var error?/eax: boolean <- has-errors? trace { @@ -419,7 +419,7 @@ fn test-go-modal { var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x80/width=72, 0x10/height, 0/no-pixel-graphics # hit ctrl-g - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal/0" @@ -454,10 +454,10 @@ fn test-leave-go-modal { var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x80/width=72, 0x10/height, 0/no-pixel-graphics # hit ctrl-g - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # cancel - edit-environment env, 0x1b/escape, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x1b/escape, 0/no-disk render-environment screen, env # no modal check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-leave-go-modal/0" @@ -488,15 +488,15 @@ fn test-jump-to-global { initialize-screen screen, 0x80/width=72, 0x10/height, 0/no-pixel-graphics # define a global type-in env, screen, "(define f 42)" - edit-environment env, 0x13/ctrl-s, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x13/ctrl-s, 0/no-disk render-environment screen, env # hit ctrl-g - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # type global name type-in env, screen, "f" # submit - edit-environment env, 0xa/newline, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0xa/newline, 0/no-disk render-environment screen, env # | global definitions | sandbox # cursor now in global definition @@ -532,7 +532,7 @@ fn test-go-modal-prepopulates-word-at-cursor { # type a word at the cursor type-in env, screen, "fn1" # hit ctrl-g - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # modal prepopulates word at cursor check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/0" @@ -557,13 +557,13 @@ fn test-go-modal-prepopulates-word-at-cursor { check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/14" check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/15" # cancel - edit-environment env, 0x1b/escape, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x1b/escape, 0/no-disk render-environment screen, env # type one more space - edit-environment env, 0x20/space, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x20/space, 0/no-disk render-environment screen, env # hit ctrl-g again - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # no word prepopulated since cursor is not on the word check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-0" @@ -588,15 +588,15 @@ fn test-go-modal-prepopulates-word-at-cursor { check-background-color-in-screen-row screen, 0xf/bg=modal, 0xe/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-14" check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test2-15" # cancel - edit-environment env, 0x1b/escape, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x1b/escape, 0/no-disk render-environment screen, env # move cursor to the left until it's on the word again - edit-environment env, 0x80/left-arrow, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x80/left-arrow, 0/no-disk render-environment screen, env - edit-environment env, 0x80/left-arrow, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x80/left-arrow, 0/no-disk render-environment screen, env # hit ctrl-g again - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # word prepopulated like before check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-go-modal-prepopulates-word-at-cursor/test3-0" @@ -633,10 +633,10 @@ fn test-jump-to-nonexistent-global { # type in any (nonexistent) global name type-in env, screen, "f" # hit ctrl-g - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # submit - edit-environment env, 0xa/newline, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0xa/newline, 0/no-disk render-environment screen, env # modal now shows an error # | global definitions | sandbox @@ -663,10 +663,10 @@ fn test-jump-to-nonexistent-global { check-screen-row screen, 0xf/y, " ^r run main enter go ^m create esc cancel ^a << ^b ^e >> ", "F - test-jump-to-nonexistent-global/15-text" check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-jump-to-nonexistent-global/15" # cancel - edit-environment env, 0x1b/escape, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x1b/escape, 0/no-disk render-environment screen, env # hit ctrl-g again - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # word prepopulated like before, but no error check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-jump-to-nonexistent-global/test2-0" @@ -702,12 +702,12 @@ fn test-create-global { var screen/edi: (addr screen) <- address screen-on-stack initialize-screen screen, 0x80/width=72, 0x10/height, 0/no-pixel-graphics # hit ctrl-g - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # type global name type-in env, screen, "fn1" # create - edit-environment env, 0xd/ctrl-m, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0xd/ctrl-m, 0/no-disk render-environment screen, env # | global definitions | sandbox # cursor now on global side @@ -741,15 +741,15 @@ fn test-create-nonexistent-global { initialize-screen screen, 0x80/width=72, 0x10/height, 0/no-pixel-graphics # define a global type-in env, screen, "(define f 42)" - edit-environment env, 0x13/ctrl-s, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x13/ctrl-s, 0/no-disk render-environment screen, env # type in its name type-in env, screen, "f" # hit ctrl-g - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # submit - edit-environment env, 0xd/ctrl-m, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0xd/ctrl-m, 0/no-disk render-environment screen, env # modal now shows an error # | global definitions | sandbox @@ -776,10 +776,10 @@ fn test-create-nonexistent-global { check-screen-row screen, 0xf/y, " ^r run main enter go ^m create esc cancel ^a << ^b ^e >> ", "F - test-create-nonexistent-global/15-text" check-background-color-in-screen-row screen, 0xf/bg=modal, 0xf/y, " ", "F - test-create-nonexistent-global/15" # cancel - edit-environment env, 0x1b/escape, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 0x1b/escape, 0/no-disk render-environment screen, env # hit ctrl-g again - edit-environment env, 7/ctrl-g, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-environment env, 7/ctrl-g, 0/no-disk render-environment screen, env # word prepopulated like before, but no error check-background-color-in-screen-row screen, 0xf/bg=modal, 0/y, " ", "F - test-create-nonexistent-global/test2-0" diff --git a/shell/evaluate.mu b/shell/evaluate.mu index 32572010..70cd544d 100644 --- a/shell/evaluate.mu +++ b/shell/evaluate.mu @@ -8,7 +8,7 @@ # stops if a keypress is encountered # Inner screen is what Lisp programs modify. Outer screen is shows the program # and its inner screen to the environment. -fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), outer-screen: (addr screen), outer-keyboard: (addr keyboard), call-number: int { +fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), call-number: int { # stack overflow? # disable when enabling Really-debug-print check-stack { @@ -34,8 +34,8 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var screen-obj/eax: (addr screen) <- lookup *screen-obj-ah compare screen-obj, 0 break-if-= - var y/ecx: int <- render-screen outer-screen, screen-obj, 0x58/xmin, 2/ymin - var key/eax: byte <- read-key outer-keyboard + var y/ecx: int <- render-screen 0/screen, screen-obj, 0x58/xmin, 2/ymin + var key/eax: byte <- read-key 0/keyboard compare key, 0 break-if-= error trace, "key pressed; interrupting..." @@ -211,7 +211,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han # trace-text trace, "eval", "backquote" debug-print "`(", 7/fg, 0/bg - evaluate-backquote rest-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate-backquote rest-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print ")", 7/fg, 0/bg trace-higher trace return @@ -245,7 +245,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var second-arg-ah/edx: (addr handle cell) <- get rest, left debug-print "P", 4/fg, 0/bg increment call-number - evaluate second-arg-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate second-arg-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "Q", 4/fg, 0/bg # errors? skip { @@ -305,7 +305,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var second-arg-ah/edx: (addr handle cell) <- get rest, left debug-print "P", 4/fg, 0/bg increment call-number - evaluate second-arg-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate second-arg-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "Q", 4/fg, 0/bg # errors? skip { @@ -339,7 +339,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var first-arg-ah/ecx: (addr handle cell) <- get rest, left debug-print "R2", 4/fg, 0/bg increment call-number - evaluate first-arg-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate first-arg-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "S2", 4/fg, 0/bg # errors? skip { @@ -365,7 +365,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var second-ah/eax: (addr handle cell) <- get rest, left debug-print "T2", 4/fg, 0/bg increment call-number - evaluate second-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate second-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "U2", 4/fg, 0/bg trace-higher trace return @@ -386,7 +386,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var first-arg-ah/ecx: (addr handle cell) <- get rest, left debug-print "R2", 4/fg, 0/bg increment call-number - evaluate first-arg-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate first-arg-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "S2", 4/fg, 0/bg # errors? skip { @@ -412,7 +412,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var second-ah/eax: (addr handle cell) <- get rest, left debug-print "T2", 4/fg, 0/bg increment call-number - evaluate second-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate second-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "U2", 4/fg, 0/bg # errors? skip { @@ -444,7 +444,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var guard-ah/esi: (addr handle cell) <- address guard-h debug-print "R", 4/fg, 0/bg increment call-number - evaluate first-arg-ah, guard-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate first-arg-ah, guard-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "S", 4/fg, 0/bg # errors? skip { @@ -470,7 +470,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han } debug-print "T", 4/fg, 0/bg increment call-number - evaluate branch-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate branch-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "U", 4/fg, 0/bg trace-higher trace return @@ -506,7 +506,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han trace-text trace, "eval", "loop termination check" debug-print "V", 4/fg, 0/bg increment call-number - evaluate first-arg-ah, guard-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate first-arg-ah, guard-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "W", 4/fg, 0/bg # errors? skip { @@ -520,7 +520,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var done?/eax: boolean <- nil? guard-a compare done?, 0/false break-if-!= - evaluate-exprs rest-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate-exprs rest-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number # errors? skip { var error?/eax: boolean <- has-errors? trace @@ -566,7 +566,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var left-ah/esi: (addr handle cell) <- get curr, left debug-print "A", 4/fg, 0/bg increment call-number - evaluate left-ah, left-out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate left-ah, left-out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "B", 4/fg, 0/bg # errors? skip { @@ -589,7 +589,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han var function-ah/ecx: (addr handle cell) <- get evaluated-list, left var args-ah/edx: (addr handle cell) <- get evaluated-list, right debug-print "C", 4/fg, 0/bg - apply function-ah, args-ah, _out-ah, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + apply function-ah, args-ah, _out-ah, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "Y", 4/fg, 0/bg trace-higher trace # trace "=> " _out-ah {{{ @@ -610,7 +610,7 @@ fn evaluate _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (han debug-print "Z", 4/fg, 0/bg } -fn apply _f-ah: (addr handle cell), args-ah: (addr handle cell), out: (addr handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), outer-screen: (addr screen), outer-keyboard: (addr keyboard), call-number: int { +fn apply _f-ah: (addr handle cell), args-ah: (addr handle cell), out: (addr handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), call-number: int { var f-ah/eax: (addr handle cell) <- copy _f-ah var _f/eax: (addr cell) <- lookup *f-ah var f/esi: (addr cell) <- copy _f @@ -660,7 +660,7 @@ fn apply _f-ah: (addr handle cell), args-ah: (addr handle cell), out: (addr hand var params-ah/ecx: (addr handle cell) <- get rest, left var body-ah/eax: (addr handle cell) <- get rest, right debug-print "D", 7/fg, 0/bg - apply-function params-ah, args-ah, body-ah, out, *callee-env-ah, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + apply-function params-ah, args-ah, body-ah, out, *callee-env-ah, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "Y", 7/fg, 0/bg trace-higher trace return @@ -668,7 +668,7 @@ fn apply _f-ah: (addr handle cell), args-ah: (addr handle cell), out: (addr hand error trace, "unknown function" } -fn apply-function params-ah: (addr handle cell), args-ah: (addr handle cell), body-ah: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), outer-screen: (addr screen), outer-keyboard: (addr keyboard), call-number: int { +fn apply-function params-ah: (addr handle cell), args-ah: (addr handle cell), body-ah: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), call-number: int { # push bindings for params to env var new-env-h: (handle cell) var new-env-ah/esi: (addr handle cell) <- address new-env-h @@ -681,10 +681,10 @@ fn apply-function params-ah: (addr handle cell), args-ah: (addr handle cell), bo return } # - evaluate-exprs body-ah, out, new-env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate-exprs body-ah, out, new-env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number } -fn evaluate-exprs _exprs-ah: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), outer-screen: (addr screen), outer-keyboard: (addr keyboard), call-number: int { +fn evaluate-exprs _exprs-ah: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), call-number: int { # eval all exprs, writing result to `out` each time var exprs-ah/ecx: (addr handle cell) <- copy _exprs-ah $evaluate-exprs:loop: { @@ -700,7 +700,7 @@ fn evaluate-exprs _exprs-ah: (addr handle cell), out: (addr handle cell), env-h: var curr-ah/eax: (addr handle cell) <- get exprs, left debug-print "E", 7/fg, 0/bg increment call-number - evaluate curr-ah, out, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate curr-ah, out, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "X", 7/fg, 0/bg # errors? skip { @@ -1425,7 +1425,7 @@ fn test-evaluate-is-well-behaved { var tmp-storage: (handle cell) var tmp-ah/edx: (addr handle cell) <- address tmp-storage new-symbol tmp-ah, "a" - evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, t, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, t, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number # doesn't die check-trace-contains t, "error", "unbound symbol: a", "F - test-evaluate-is-well-behaved" } @@ -1442,7 +1442,7 @@ fn test-evaluate-number { var trace-storage: trace var trace/edi: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number # var result/eax: (addr cell) <- lookup *tmp-ah var result-type/edx: (addr int) <- get result, type @@ -1475,7 +1475,7 @@ fn test-evaluate-symbol { var trace-storage: trace var trace/edi: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number var result/eax: (addr cell) <- lookup *tmp-ah var result-type/edx: (addr int) <- get result, type check-ints-equal *result-type, 1/number, "F - test-evaluate-symbol/0" @@ -1500,7 +1500,7 @@ fn test-evaluate-quote { var trace-storage: trace var trace/edi: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate tmp-ah, tmp-ah, *nil-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, *nil-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number var result/eax: (addr cell) <- lookup *tmp-ah var result-type/edx: (addr int) <- get result, type check-ints-equal *result-type, 2/symbol, "F - test-evaluate-quote/0" @@ -1524,7 +1524,7 @@ fn test-evaluate-primitive-function { var trace-storage: trace var trace/edx: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate add-ah, tmp-ah, *nil-ah, globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate add-ah, tmp-ah, *nil-ah, globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number # var result/eax: (addr cell) <- lookup *tmp-ah var result-type/edx: (addr int) <- get result, type @@ -1559,7 +1559,7 @@ fn test-evaluate-primitive-function-call { var globals/edx: (addr global-table) <- address globals-storage initialize-globals globals # - evaluate tmp-ah, tmp-ah, *nil-ah, globals, t, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, *nil-ah, globals, t, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number #? dump-trace t # var result/eax: (addr cell) <- lookup *tmp-ah @@ -1587,7 +1587,7 @@ fn test-evaluate-backquote { var trace-storage: trace var trace/edi: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate tmp-ah, tmp2-ah, *nil-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp2-ah, *nil-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number var result/eax: (addr cell) <- lookup *tmp2-ah var result-type/edx: (addr int) <- get result, type check-ints-equal *result-type, 2/symbol, "F - test-evaluate-backquote/0" @@ -1595,7 +1595,7 @@ fn test-evaluate-backquote { check sym?, "F - test-evaluate-backquote/1" } -fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), outer-screen: (addr screen), outer-keyboard: (addr keyboard), call-number: int { +fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), inner-screen-var: (addr handle cell), inner-keyboard-var: (addr handle cell), definitions-created: (addr stream int), call-number: int { # stack overflow? # disable when enabling Really-debug-print #? dump-cell-from-cursor-over-full-screen _in-ah check-stack @@ -1657,7 +1657,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e var rest-ah/eax: (addr handle cell) <- get in, right increment call-number debug-print ",", 3/fg, 0/bg - evaluate rest-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate rest-ah, _out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print ",)", 3/fg, 0/bg trace-higher trace return @@ -1693,7 +1693,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e trace-text trace, "eval", "unquote-splice" var in-unquote-payload-ah/eax: (addr handle cell) <- get in-left, right increment call-number - evaluate in-unquote-payload-ah, out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate in-unquote-payload-ah, out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number # errors? skip { var error?/eax: boolean <- has-errors? trace @@ -1715,7 +1715,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e } # append result of in-right var in-right-ah/ecx: (addr handle cell) <- get in, right - evaluate-backquote in-right-ah, out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate-backquote in-right-ah, out-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number trace-higher trace return } @@ -1729,7 +1729,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e var out/eax: (addr cell) <- lookup *out-ah var out-left-ah/edx: (addr handle cell) <- get out, left debug-print "`(l", 3/fg, 0/bg - evaluate-backquote in-left-ah, out-left-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate-backquote in-left-ah, out-left-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "`r)", 3/fg, 0/bg # errors? skip { @@ -1742,7 +1742,7 @@ fn evaluate-backquote _in-ah: (addr handle cell), _out-ah: (addr handle cell), e var in-right-ah/ecx: (addr handle cell) <- get in, right var out-right-ah/edx: (addr handle cell) <- get out, right debug-print "`r(", 3/fg, 0/bg - evaluate-backquote in-right-ah, out-right-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, outer-screen, outer-keyboard, call-number + evaluate-backquote in-right-ah, out-right-ah, env-h, globals, trace, inner-screen-var, inner-keyboard-var, definitions-created, call-number debug-print "`r)", 3/fg, 0/bg trace-higher trace } @@ -1770,7 +1770,7 @@ fn test-evaluate-backquote-list { var trace-storage: trace var trace/edi: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate tmp-ah, tmp-ah, *nil-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, *nil-ah, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number # result is (a b) var result/eax: (addr cell) <- lookup *tmp-ah { @@ -1836,7 +1836,7 @@ fn test-evaluate-backquote-list-with-unquote { var trace-storage: trace var trace/edi: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate tmp-ah, tmp-ah, env-h, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, env-h, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number # result is (a 3) var result/eax: (addr cell) <- lookup *tmp-ah { @@ -1910,7 +1910,7 @@ fn test-evaluate-backquote-list-with-unquote-splice { var trace-storage: trace var trace/edi: (addr trace) <- address trace-storage initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible - evaluate tmp-ah, tmp-ah, env-h, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, env-h, 0/no-globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number # result is (a a 3 b) #? dump-cell-from-cursor-over-full-screen tmp-ah var result/eax: (addr cell) <- lookup *tmp-ah diff --git a/shell/global.mu b/shell/global.mu index 60630c41..8c44537b 100644 --- a/shell/global.mu +++ b/shell/global.mu @@ -290,7 +290,7 @@ fn refresh-definition _self: (addr global-table), _index: int { var curr-value-ah/edi: (addr handle cell) <- get curr-global, value var definitions-created-storage: (stream int 0x10) var definitions-created/ecx: (addr stream int) <- address definitions-created-storage - read-and-evaluate-and-save-gap-buffer-to-globals curr-input-ah, curr-value-ah, self, definitions-created, curr-trace, 0/no-inner-screen-var, 0/no-inner-keyboard-var, 0/unused-outer-screen, 0/unused-outer-keyboard + read-and-evaluate-and-save-gap-buffer-to-globals curr-input-ah, curr-value-ah, self, definitions-created, curr-trace, 0/no-screen, 0/no-keyboard } fn assign-or-create-global _self: (addr global-table), name: (addr array byte), value: (handle cell), index-updated: (addr int), trace: (addr trace) { @@ -547,7 +547,7 @@ fn load-lexical-scope in-ah: (addr handle gap-buffer), _globals: (addr global-ta initialize-trace trace, 1/only-errors, 0x10/capacity, 0/visible var dummy-result-h: (handle cell) var dummy-result-ah/ecx: (addr handle cell) <- address dummy-result-h - read-and-evaluate-and-save-gap-buffer-to-globals in-ah, dummy-result-ah, globals, definitions-created, trace, 0/no-inner-screen-var, 0/no-inner-keyboard-var, 0/unused-outer-screen, 0/unused-outer-keyboard + read-and-evaluate-and-save-gap-buffer-to-globals in-ah, dummy-result-ah, globals, definitions-created, trace, 0/no-inner-screen-var, 0/no-inner-keyboard-var # # save trace to all needed globals as well rewind-stream definitions-created diff --git a/shell/macroexpand.mu b/shell/macroexpand.mu index efdbb02f..0f3837c7 100644 --- a/shell/macroexpand.mu +++ b/shell/macroexpand.mu @@ -269,7 +269,7 @@ fn macroexpand-iter _expr-ah: (addr handle cell), globals: (addr global-table), var macro-definition-ah/eax: (addr handle cell) <- get definition, right # TODO: check car(macro-definition) is litfn #? turn-on-debug-print - apply macro-definition-ah, rest-ah, expr-ah, globals, trace, 0/no-inner-screen-var, 0/no-inner-keyboard-var, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + apply macro-definition-ah, rest-ah, expr-ah, globals, trace, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number trace-higher trace # trace "1=> " _expr-ah {{{ { @@ -402,7 +402,7 @@ fn test-macroexpand { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))" - edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk # invoke macro initialize-sandbox-with sandbox, "(m 3 4)" var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data @@ -441,7 +441,7 @@ fn test-macroexpand-inside-anonymous-fn { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))" - edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk # invoke macro initialize-sandbox-with sandbox, "(fn() (m 3 4))" var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data @@ -479,7 +479,7 @@ fn test-macroexpand-inside-fn-call { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))" - edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk # invoke macro initialize-sandbox-with sandbox, "((fn() (m 3 4)))" var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data @@ -548,7 +548,7 @@ fn pending-test-macroexpand-inside-backquote-unquote { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))" - edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk # invoke macro initialize-sandbox-with sandbox, "`(print [result is ] ,(m 3 4)))" var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data @@ -586,7 +586,7 @@ fn pending-test-macroexpand-inside-nested-backquote-unquote { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "(define m (litmac litfn () (a b) `(+ ,a ,b)))" - edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, globals, 0/no-disk # invoke macro initialize-sandbox-with sandbox, "`(a ,(m 3 4) `(b ,(m 3 4) ,,(m 3 4)))" var gap-ah/ecx: (addr handle gap-buffer) <- get sandbox, data diff --git a/shell/main.mu b/shell/main.mu index 59936985..7e4bc32c 100644 --- a/shell/main.mu +++ b/shell/main.mu @@ -14,7 +14,7 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) compare key, 0 loop-if-= var key/eax: grapheme <- copy key - edit-environment env, key, data-disk, screen, keyboard + edit-environment env, key, data-disk } loop } diff --git a/shell/primitives.mu b/shell/primitives.mu index 2c2c4880..3ea943a5 100644 --- a/shell/primitives.mu +++ b/shell/primitives.mu @@ -508,7 +508,7 @@ fn test-evaluate-missing-arg-in-add { var globals/edx: (addr global-table) <- address globals-storage initialize-globals globals # - evaluate tmp-ah, tmp-ah, *nil-ah, globals, t, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/unused-outer-screen, 0/unused-outer-keyboard, 0/call-number + evaluate tmp-ah, tmp-ah, *nil-ah, globals, t, 0/no-screen, 0/no-keyboard, 0/definitions-created, 0/call-number # no crash } diff --git a/shell/sandbox.mu b/shell/sandbox.mu index 1a72641d..1b6cd61e 100644 --- a/shell/sandbox.mu +++ b/shell/sandbox.mu @@ -257,56 +257,29 @@ fn render-empty-screen screen: (addr screen), _target-screen: (addr screen), xmi fn render-screen screen: (addr screen), _target-screen: (addr screen), xmin: int, ymin: int -> _/ecx: int { var target-screen/esi: (addr screen) <- copy _target-screen + var screen-y/edi: int <- copy ymin # text data - var width-a/eax: (addr int) <- get target-screen, width - var width/eax: int <- copy *width-a - var xmax: int - copy-to xmax, width - var tmp/eax: int <- copy xmin - add-to xmax, tmp - var height-a/eax: (addr int) <- get target-screen, height - var height/eax: int <- copy *height-a - var ymax: int - copy-to ymax, height - var tmp/eax: int <- copy ymin - add-to ymax, tmp - clear-rect screen, xmin, ymin, xmax, ymax, 0/bg - var data-ah/eax: (addr handle array screen-cell) <- get target-screen, data - var data/eax: (addr array screen-cell) <- lookup *data-ah - var index/ecx: int <- copy 0 - var to-y/edi: int <- copy ymin { - compare to-y, ymax - break-if->= - var to-x/ebx: int <- copy xmin + var height/edx: (addr int) <- get target-screen, height + var y/ecx: int <- copy 0 { - compare to-x, xmax + compare y, *height break-if->= - $render-screen:iter: { - var offset/ecx: (offset screen-cell) <- compute-offset data, index - var src-cell/edx: (addr screen-cell) <- index data, offset - var src-grapheme/eax: (addr grapheme) <- get src-cell, data - var src-fg/ecx: (addr int) <- get src-cell, color - var src-bg/edx: (addr int) <- get src-cell, background-color - { - compare *src-grapheme, 0x20 - break-if-!= - compare *src-bg, 0 - break-if-!= - break $render-screen:iter - } - abort "aa" - draw-grapheme-on-real-screen *src-grapheme, to-x, to-y, *src-fg, *src-bg -#? var foo/eax: int <- count-of-events -#? draw-grapheme-on-real-screen 0x20/space, to-x, to-y, *src-fg, foo -#? count-event + set-cursor-position screen, xmin, screen-y + var width/edx: (addr int) <- get target-screen, width + var x/ebx: int <- copy 0 + { + compare x, *width + break-if->= + print-screen-cell-of-fake-screen screen, target-screen, x, y + move-cursor-right screen + x <- increment + loop } - index <- increment - to-x <- increment + y <- increment + screen-y <- increment loop } - to-y <- increment - loop } # pixel data { @@ -358,7 +331,7 @@ fn render-screen screen: (addr screen), _target-screen: (addr screen), xmin: int loop } } - return ymax + return screen-y } fn has-keyboard? _self: (addr sandbox) -> _/eax: boolean { @@ -430,7 +403,7 @@ fn render-keyboard screen: (addr screen), _keyboard: (addr gap-buffer), xmin: in return y } -fn print-screen-cell-of-fake-screen-at-cursor screen: (addr screen), _target: (addr screen), x: int, y: int { +fn print-screen-cell-of-fake-screen screen: (addr screen), _target: (addr screen), x: int, y: int { var target/ecx: (addr screen) <- copy _target var data-ah/eax: (addr handle array screen-cell) <- get target, data var data/eax: (addr array screen-cell) <- lookup *data-ah @@ -443,19 +416,6 @@ fn print-screen-cell-of-fake-screen-at-cursor screen: (addr screen), _target: (a draw-grapheme-at-cursor screen, *src-grapheme, *src-color, *src-background-color } -fn print-screen-cell-of-fake-screen screen: (addr screen), _target: (addr screen), from-x: int, from-y: int, to-x: int, to-y: int { - var target/ecx: (addr screen) <- copy _target - var data-ah/eax: (addr handle array screen-cell) <- get target, data - var data/eax: (addr array screen-cell) <- lookup *data-ah - var index/ecx: int <- screen-cell-index target, from-x, from-y - var offset/ecx: (offset screen-cell) <- compute-offset data, index - var src-cell/esi: (addr screen-cell) <- index data, offset - var src-grapheme/eax: (addr grapheme) <- get src-cell, data - var src-fg/ecx: (addr int) <- get src-cell, color - var src-bg/edx: (addr int) <- get src-cell, background-color - draw-grapheme screen, *src-grapheme, to-x, to-y, *src-fg, *src-bg -} - fn render-sandbox-edit-menu screen: (addr screen), _self: (addr sandbox) { var _width/eax: int <- copy 0 var height/ecx: int <- copy 0 @@ -516,7 +476,7 @@ fn render-keyboard-menu screen: (addr screen) { draw-text-rightward-from-cursor screen, " to sandbox ", width, 7/fg, 0xc5/bg=blue-bg } -fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-table), data-disk: (addr disk), outer-screen: (addr screen), outer-keyboard: (addr keyboard) { +fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-table), data-disk: (addr disk) { var self/esi: (addr sandbox) <- copy _self # ctrl-s { @@ -530,7 +490,7 @@ fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-tabl # persisted until the next call to ctrl-s. store-state data-disk, self, globals # - run-sandbox self, globals, outer-screen, outer-keyboard + run-sandbox self, globals return } # ctrl-m @@ -649,7 +609,7 @@ fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-tabl # rerun at higher depth var max-depth-addr/ecx: (addr int) <- get trace, max-depth increment *max-depth-addr - run-sandbox self, globals, outer-screen, outer-keyboard + run-sandbox self, globals # recompute cached indices recompute-all-visible-lines trace var save-addr/ecx: (addr trace-index-stash) <- address save @@ -660,7 +620,7 @@ fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-tabl } } -fn run-sandbox _self: (addr sandbox), globals: (addr global-table), outer-screen: (addr screen), outer-keyboard: (addr keyboard) { +fn run-sandbox _self: (addr sandbox), globals: (addr global-table) { var self/esi: (addr sandbox) <- copy _self var data-ah/ecx: (addr handle gap-buffer) <- get self, data var eval-result-h: (handle cell) @@ -678,7 +638,7 @@ fn run-sandbox _self: (addr sandbox), globals: (addr global-table), outer-screen var inner-keyboard-var/eax: (addr handle cell) <- get self, keyboard-var rewind-keyboard-var inner-keyboard-var # don't clear keys from before # - read-and-evaluate-and-save-gap-buffer-to-globals data-ah, eval-result-ah, globals, definitions-created, trace, inner-screen-var, inner-keyboard-var, outer-screen, outer-keyboard + read-and-evaluate-and-save-gap-buffer-to-globals data-ah, eval-result-ah, globals, definitions-created, trace, inner-screen-var, inner-keyboard-var # if necessary, initialize a new gap-buffer for sandbox { compare globals, 0 @@ -706,7 +666,7 @@ fn test-run-integer { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "1" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -724,7 +684,7 @@ fn test-run-negative-integer { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "-1" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -742,7 +702,7 @@ fn test-run-error-invalid-integer { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "1a" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -760,7 +720,7 @@ fn test-run-error-unknown-symbol { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "a" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -778,7 +738,7 @@ fn test-run-with-spaces { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, " 1 \n" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -797,7 +757,7 @@ fn test-run-quote { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "'a" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -815,7 +775,7 @@ fn test-run-dotted-list { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "'(a . b)" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -833,7 +793,7 @@ fn test-run-dot-and-list { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "'(a . (b))" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -851,7 +811,7 @@ fn test-run-final-dot { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "'(a .)" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -870,7 +830,7 @@ fn test-run-double-dot { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "'(a . .)" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -889,7 +849,7 @@ fn test-run-multiple-expressions-after-dot { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "'(a . b c)" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -908,7 +868,7 @@ fn test-run-stream { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "[a b]" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -926,7 +886,7 @@ fn test-run-move-cursor-into-trace { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "12" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -941,7 +901,7 @@ fn test-run-move-cursor-into-trace { check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/pre-2" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/pre-2/cursor" # move cursor into trace - edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk # render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor # skip one line of padding @@ -952,7 +912,7 @@ fn test-run-move-cursor-into-trace { check-screen-row screen, 3/y, " => 12 ", "F - test-run-move-cursor-into-trace/trace-2" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-move-cursor-into-trace/trace-2/cursor" # move cursor into input - edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk # render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor # skip one line of padding @@ -988,7 +948,7 @@ fn test-run-expand-trace { var sandbox/esi: (addr sandbox) <- address sandbox-storage initialize-sandbox-with sandbox, "12" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -1003,7 +963,7 @@ fn test-run-expand-trace { check-screen-row screen, 3/y, " => 12 ", "F - test-run-expand-trace/pre0-2" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/pre0-2/cursor" # move cursor into trace - edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk # render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor # skip one line of padding @@ -1014,7 +974,7 @@ fn test-run-expand-trace { check-screen-row screen, 3/y, " => 12 ", "F - test-run-expand-trace/pre1-2" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-expand-trace/pre1-2/cursor" # expand - edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk # clear-screen screen render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor @@ -1035,7 +995,7 @@ fn test-run-can-rerun-when-expanding-trace { # initialize sandbox with a max-depth of 3 initialize-sandbox-with sandbox, "12" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -1050,7 +1010,7 @@ fn test-run-can-rerun-when-expanding-trace { check-screen-row screen, 3/y, " => 12 ", "F - test-run-can-rerun-when-expanding-trace/pre0-2" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre0-2/cursor" # move cursor into trace - edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk # render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor # skip one line of padding @@ -1061,7 +1021,7 @@ fn test-run-can-rerun-when-expanding-trace { check-screen-row screen, 3/y, " => 12 ", "F - test-run-can-rerun-when-expanding-trace/pre1-2" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre1-2/cursor" # expand - edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk # clear-screen screen render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor @@ -1075,9 +1035,9 @@ fn test-run-can-rerun-when-expanding-trace { check-screen-row screen, 4/y, " 1 pars", "F - test-run-can-rerun-when-expanding-trace/pre2-2" check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, " ", "F - test-run-can-rerun-when-expanding-trace/pre2-2/cursor" # move cursor down and expand - edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor - edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk # clear-screen screen render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor @@ -1100,7 +1060,7 @@ fn test-run-preserves-trace-view-on-rerun { # initialize sandbox with a max-depth of 3 initialize-sandbox-with sandbox, "7" # eval - edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x13/ctrl-s, 0/no-globals, 0/no-disk # setup: screen var screen-on-stack: screen var screen/edi: (addr screen) <- address screen-on-stack @@ -1115,7 +1075,7 @@ fn test-run-preserves-trace-view-on-rerun { check-screen-row screen, 3/y, " => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre0-2" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre0-2/cursor" # move cursor into trace - edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xd/ctrl-m, 0/no-globals, 0/no-disk render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor # check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre1-0" @@ -1125,7 +1085,7 @@ fn test-run-preserves-trace-view-on-rerun { check-screen-row screen, 3/y, " => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre1-2" check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre1-2/cursor" # expand - edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk clear-screen screen render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor # @@ -1146,15 +1106,15 @@ fn test-run-preserves-trace-view-on-rerun { check-screen-row screen, 8/y, " 1 => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre2-7" check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre2-7/cursor" # move cursor down below the macroexpand line and expand - edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor - edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor - edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor - edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor - edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0x6a/j, 0/no-globals, 0/no-disk render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor # check-screen-row screen, 1/y, " 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-0" @@ -1174,7 +1134,7 @@ fn test-run-preserves-trace-view-on-rerun { check-screen-row screen, 8/y, " 1 => 7 ", "F - test-run-preserves-trace-view-on-rerun/pre3-7" check-background-color-in-screen-row screen, 7/bg=cursor, 8/y, " ", "F - test-run-preserves-trace-view-on-rerun/pre3-7/cursor" # expand - edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk, 0/unused-outer-screen, 0/unused-outer-keyboard + edit-sandbox sandbox, 0xa/newline, 0/no-globals, 0/no-disk clear-screen screen render-sandbox screen, sandbox, 0/x, 0/y, 0x80/width, 0x10/height, 1/show-cursor # cursor line is expanded -- cgit 1.4.1-2-gfad0