diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-04-10 20:44:26 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-04-10 20:44:26 -0700 |
commit | 400574f956f8428785ecefe5536ebf5512f23408 (patch) | |
tree | 1575a3332a2b34b1221ab1294830b5953b2ba1a8 /shell | |
parent | 6fa86619b286cae8a1a990ce5ac845d2b80428ca (diff) | |
download | mu-400574f956f8428785ecefe5536ebf5512f23408.tar.gz |
shell: move fake screen to sandbox
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cell.mu | 13 | ||||
-rw-r--r-- | shell/evaluate.mu | 43 | ||||
-rw-r--r-- | shell/global.mu | 61 | ||||
-rw-r--r-- | shell/main.mu | 2 | ||||
-rw-r--r-- | shell/sandbox.mu | 74 |
5 files changed, 86 insertions, 107 deletions
diff --git a/shell/cell.mu b/shell/cell.mu index b2b302e6..9dfe298b 100644 --- a/shell/cell.mu +++ b/shell/cell.mu @@ -135,3 +135,16 @@ fn new-screen _out: (addr handle cell), width: int, height: int { var dest-addr/eax: (addr screen) <- lookup *dest-ah initialize-screen dest-addr, width, height } + +fn clear-screen-cell _self-ah: (addr handle cell) { + var self-ah/eax: (addr handle cell) <- copy _self-ah + var self/eax: (addr cell) <- lookup *self-ah + compare self, 0 + { + break-if-!= + return + } + var screen-ah/eax: (addr handle screen) <- get self, screen-data + var screen/eax: (addr screen) <- lookup *screen-ah + clear-screen screen +} diff --git a/shell/evaluate.mu b/shell/evaluate.mu index 19fe9fdc..2966751e 100644 --- a/shell/evaluate.mu +++ b/shell/evaluate.mu @@ -1,6 +1,7 @@ # env is an alist of ((sym . val) (sym . val) ...) # we never modify `in` or `env` -fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace) { +# ignore 'screen-cell' on a first reading; it's a hack for sandboxes +fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), screen-cell: (addr handle cell) { var in/esi: (addr handle cell) <- copy _in #? dump-cell in #? { @@ -46,7 +47,7 @@ fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cel { break-if-!= trace-text trace, "eval", "symbol" - lookup-symbol in-addr, out, env-h, globals, trace + lookup-symbol in-addr, out, env-h, globals, trace, screen-cell trace-higher trace return } @@ -120,7 +121,7 @@ fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cel rest-ah <- get rest, right rest <- lookup *rest-ah var second-arg-ah/edx: (addr handle cell) <- get rest, left - evaluate second-arg-ah, out, env-h, globals, trace + evaluate second-arg-ah, out, env-h, globals, trace, screen-cell trace-text trace, "eval", "saving global binding" var first-arg/eax: (addr cell) <- lookup *first-arg-ah var first-arg-data-ah/eax: (addr handle stream byte) <- get first-arg, text-data @@ -157,7 +158,7 @@ fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cel var first-arg-ah/ecx: (addr handle cell) <- get rest, left var guard-h: (handle cell) var guard-ah/esi: (addr handle cell) <- address guard-h - evaluate first-arg-ah, guard-ah, env-h, globals, trace + evaluate first-arg-ah, guard-ah, env-h, globals, trace, screen-cell rest-ah <- get rest, right rest <- lookup *rest-ah var branch-ah/edi: (addr handle cell) <- get rest, left @@ -172,7 +173,7 @@ fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cel rest <- lookup *rest-ah branch-ah <- get rest, left } - evaluate branch-ah, out, env-h, globals, trace + evaluate branch-ah, out, env-h, globals, trace, screen-cell trace-higher trace return } @@ -191,7 +192,7 @@ fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cel var curr-out/eax: (addr cell) <- lookup *curr-out-ah var left-out-ah/edi: (addr handle cell) <- get curr-out, left var left-ah/esi: (addr handle cell) <- get curr, left - evaluate left-ah, left-out-ah, env-h, globals, trace + evaluate left-ah, left-out-ah, env-h, globals, trace, screen-cell # curr-out-ah <- get curr-out, right var right-ah/eax: (addr handle cell) <- get curr, right @@ -204,7 +205,7 @@ fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cel var args-ah/edx: (addr handle cell) <- get evaluated-list, right #? dump-cell args-ah #? abort "aaa" - apply function-ah, args-ah, out, env-h, globals, trace + apply function-ah, args-ah, out, env-h, globals, trace, screen-cell trace-higher trace # trace "=> " out {{{ { @@ -217,7 +218,7 @@ fn evaluate _in: (addr handle cell), out: (addr handle cell), env-h: (handle cel # }}} } -fn apply _f-ah: (addr handle cell), args-ah: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace) { +fn apply _f-ah: (addr handle cell), args-ah: (addr handle cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), screen-cell: (addr handle cell) { 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 @@ -256,14 +257,14 @@ fn apply _f-ah: (addr handle cell), args-ah: (addr handle cell), out: (addr hand var rest/eax: (addr cell) <- lookup *rest-ah var params-ah/ecx: (addr handle cell) <- get rest, left var body-ah/eax: (addr handle cell) <- get rest, right - apply-function params-ah, args-ah, body-ah, out, env-h, globals, trace + apply-function params-ah, args-ah, body-ah, out, env-h, globals, trace, screen-cell trace-higher trace return } 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) { +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), screen-cell: (addr handle cell) { # push bindings for params to env var new-env-storage: (handle cell) var new-env-ah/esi: (addr handle cell) <- address new-env-storage @@ -281,7 +282,7 @@ fn apply-function params-ah: (addr handle cell), args-ah: (addr handle cell), _b # evaluate each expression, writing result to `out` { var curr-ah/eax: (addr handle cell) <- get body, left - evaluate curr-ah, out, *new-env-ah, globals, trace + evaluate curr-ah, out, *new-env-ah, globals, trace, screen-cell } # body-ah <- get body, right @@ -374,7 +375,7 @@ fn push-bindings _params-ah: (addr handle cell), _args-ah: (addr handle cell), o trace-higher trace } -fn lookup-symbol sym: (addr cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace) { +fn lookup-symbol sym: (addr cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), screen-cell: (addr handle cell) { # trace sym { var stream-storage: (stream byte 0x40) @@ -407,7 +408,7 @@ fn lookup-symbol sym: (addr cell), out: (addr handle cell), env-h: (handle cell) var env-nil?/eax: boolean <- nil? env compare env-nil?, 0/false break-if-= - lookup-symbol-in-globals sym, out, globals, trace + lookup-symbol-in-globals sym, out, globals, trace, screen-cell trace-higher trace # trace "=> " out " (global)" {{{ { @@ -479,7 +480,7 @@ fn lookup-symbol sym: (addr cell), out: (addr handle cell), env-h: (handle cell) var env-tail-storage: (handle cell) var env-tail-ah/eax: (addr handle cell) <- address env-tail-storage cdr env, env-tail-ah, trace - lookup-symbol sym, out, *env-tail-ah, globals, trace + lookup-symbol sym, out, *env-tail-ah, globals, trace, screen-cell trace-higher trace # trace "=> " out " (recurse)" {{{ { @@ -517,7 +518,7 @@ fn test-lookup-symbol-in-env { var tmp-ah/edx: (addr handle cell) <- address tmp-storage new-symbol tmp-ah, "a" var in/eax: (addr cell) <- lookup *tmp-ah - lookup-symbol in, tmp-ah, *env-ah, 0/no-globals, 0/no-trace + lookup-symbol in, tmp-ah, *env-ah, 0/no-globals, 0/no-trace, 0/no-screen 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-lookup-symbol-in-env/0" @@ -539,7 +540,7 @@ fn test-lookup-symbol-in-globals { var tmp-ah/ebx: (addr handle cell) <- address tmp-storage new-symbol tmp-ah, "+" var in/eax: (addr cell) <- lookup *tmp-ah - lookup-symbol in, tmp-ah, *nil-ah, globals, 0/no-trace + lookup-symbol in, tmp-ah, *nil-ah, globals, 0/no-trace, 0/no-screen var result/eax: (addr cell) <- lookup *tmp-ah var result-type/edx: (addr int) <- get result, type check-ints-equal *result-type, 4/primitive-function, "F - test-lookup-symbol-in-globals/0" @@ -754,7 +755,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 + evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, t, 0/no-screen # doesn't die check-trace-contains t, "error", "unbound symbol: a", "F - test-evaluate-is-well-behaved" } @@ -768,7 +769,7 @@ fn test-evaluate-number { var tmp-storage: (handle cell) var tmp-ah/edx: (addr handle cell) <- address tmp-storage new-integer tmp-ah, 3 - evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, 0/no-trace + evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, 0/no-trace, 0/no-screen # var result/eax: (addr cell) <- lookup *tmp-ah var result-type/edx: (addr int) <- get result, type @@ -798,7 +799,7 @@ fn test-evaluate-symbol { 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, 0/no-trace + evaluate tmp-ah, tmp-ah, *env-ah, 0/no-globals, 0/no-trace, 0/no-screen 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" @@ -820,7 +821,7 @@ fn test-evaluate-primitive-function { # eval +, nil env var tmp-storage: (handle cell) var tmp-ah/esi: (addr handle cell) <- address tmp-storage - evaluate add-ah, tmp-ah, *nil-ah, globals, 0/no-trace + evaluate add-ah, tmp-ah, *nil-ah, globals, 0/no-trace, 0/no-screen # var result/eax: (addr cell) <- lookup *tmp-ah var result-type/edx: (addr int) <- get result, type @@ -855,7 +856,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 + evaluate tmp-ah, tmp-ah, *nil-ah, globals, t, 0/no-screen #? dump-trace t # var result/eax: (addr cell) <- lookup *tmp-ah diff --git a/shell/global.mu b/shell/global.mu index a3ec33a0..68b584ea 100644 --- a/shell/global.mu +++ b/shell/global.mu @@ -22,11 +22,6 @@ fn initialize-globals _self: (addr global-table) { append-primitive self, "cons" append-primitive self, "=" append-primitive self, "print" - # TODO: isolate screens per-sandbox - var screen-storage: (handle cell) - var screen-ah/ecx: (addr handle cell) <- address screen-storage - new-screen screen-ah, 5/width, 4/height - append-global self, "screen", *screen-ah } fn render-globals screen: (addr screen), _self: (addr global-table), xmin: int, ymin: int, xmax: int, ymax: int { @@ -48,15 +43,10 @@ fn render-globals screen: (addr screen), _self: (addr global-table), xmin: int, var curr-name-ah/eax: (addr handle array byte) <- get curr, name var _curr-name/eax: (addr array byte) <- lookup *curr-name-ah var curr-name/ebx: (addr array byte) <- copy _curr-name - { - var skip?/eax: boolean <- string-equal? curr-name, "screen" - compare skip?, 0/false - break-if-!= - var tmpx/eax: int <- copy x - tmpx <- draw-text-rightward screen, curr-name, tmpx, xmax, bottom-line, 0x2a/fg=orange, 0x12/bg=almost-black - tmpx <- draw-text-rightward screen, " ", tmpx, xmax, bottom-line, 7/fg=grey, 0x12/bg=almost-black - x <- copy tmpx - } + var tmpx/eax: int <- copy x + tmpx <- draw-text-rightward screen, curr-name, tmpx, xmax, bottom-line, 0x2a/fg=orange, 0x12/bg=almost-black + tmpx <- draw-text-rightward screen, " ", tmpx, xmax, bottom-line, 7/fg=grey, 0x12/bg=almost-black + x <- copy tmpx curr-index <- increment loop } @@ -77,9 +67,6 @@ fn render-globals screen: (addr screen), _self: (addr global-table), xmin: int, var curr-name-ah/eax: (addr handle array byte) <- get curr, name var _curr-name/eax: (addr array byte) <- lookup *curr-name-ah var curr-name/edx: (addr array byte) <- copy _curr-name - var skip?/eax: boolean <- string-equal? curr-name, "screen" - compare skip?, 0/false - break-if-!= var x/eax: int <- copy xmin x, y <- draw-text-wrapping-right-then-down screen, curr-name, xmin, ymin, xmax, ymax, x, y, 0x2a/fg=orange, 0x12/bg=almost-black x, y <- draw-text-wrapping-right-then-down screen, " <- ", xmin, ymin, xmax, ymax, x, y, 7/fg=grey, 0x12/bg=almost-black @@ -143,7 +130,7 @@ fn append-global _self: (addr global-table), name: (addr array byte), value: (ha copy-handle value, curr-value-ah } -fn lookup-symbol-in-globals _sym: (addr cell), out: (addr handle cell), _globals: (addr global-table), trace: (addr trace) { +fn lookup-symbol-in-globals _sym: (addr cell), out: (addr handle cell), _globals: (addr global-table), trace: (addr trace), screen-cell: (addr handle cell) { var sym/eax: (addr cell) <- copy _sym var sym-name-ah/eax: (addr handle stream byte) <- get sym, text-data var _sym-name/eax: (addr stream byte) <- lookup *sym-name-ah @@ -163,6 +150,16 @@ fn lookup-symbol-in-globals _sym: (addr cell), out: (addr handle cell), _globals copy-object curr-value, out return } + # if sym is "screen" and screen-cell exists, return it + { + var sym-is-screen?/eax: boolean <- stream-data-equal? sym-name, "screen" + compare sym-is-screen?, 0/false + break-if-= + compare screen-cell, 0 + break-if-= + copy-object screen-cell, out + return + } # otherwise error "unbound symbol: ", sym var stream-storage: (stream byte 0x40) var stream/ecx: (addr stream byte) <- address stream-storage @@ -668,31 +665,3 @@ fn apply-print _args-ah: (addr handle cell), out: (addr handle cell), env-h: (ha # return what was printed copy-object second-ah, out } - -fn clear-screen-var _globals: (addr global-table) { - var globals/esi: (addr global-table) <- copy _globals - var screen-literal-storage: (stream byte 8) - var screen-literal/eax: (addr stream byte) <- address screen-literal-storage - write screen-literal, "screen" - var screen-index/ecx: int <- find-symbol-in-globals globals, screen-literal - compare screen-index, -1/not-found - { - break-if-!= - return - } - var global-data-ah/eax: (addr handle array global) <- get globals, data - var global-data/eax: (addr array global) <- lookup *global-data-ah - var screen-offset/ecx: (offset global) <- compute-offset global-data, screen-index - var screen-global/eax: (addr global) <- index global-data, screen-offset - var screen-cell-ah/eax: (addr handle cell) <- get screen-global, value - var screen-cell/eax: (addr cell) <- lookup *screen-cell-ah - var screen-cell-type/ecx: (addr int) <- get screen-cell, type - compare *screen-cell-type, 5/screen - { - break-if-= - return - } - var screen-ah/eax: (addr handle screen) <- get screen-cell, screen-data - var screen/eax: (addr screen) <- lookup *screen-ah - clear-screen screen -} diff --git a/shell/main.mu b/shell/main.mu index 733091d1..a19bcead 100644 --- a/shell/main.mu +++ b/shell/main.mu @@ -7,7 +7,7 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) initialize-globals globals var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage - initialize-sandbox sandbox + initialize-sandbox sandbox, 1/with-screen load-sandbox data-disk, sandbox { render-globals screen, globals, 0/x, 0/y, 0x40/xmax, 0x2f/screen-height-without-menu diff --git a/shell/sandbox.mu b/shell/sandbox.mu index 2b68de5d..f39c9d24 100644 --- a/shell/sandbox.mu +++ b/shell/sandbox.mu @@ -1,18 +1,28 @@ type sandbox { data: (handle gap-buffer) value: (handle stream byte) + screen-var: (handle cell) trace: (handle trace) cursor-in-trace?: boolean } -fn initialize-sandbox _self: (addr sandbox) { +fn initialize-sandbox _self: (addr sandbox), screen?: boolean { var self/esi: (addr sandbox) <- copy _self var data-ah/eax: (addr handle gap-buffer) <- get self, data allocate data-ah var data/eax: (addr gap-buffer) <- lookup *data-ah initialize-gap-buffer data, 0x1000/4KB + # var value-ah/eax: (addr handle stream byte) <- get self, value populate-stream value-ah, 0x1000/4KB + # + { + compare screen?, 0/false + break-if-= + var screen-ah/eax: (addr handle cell) <- get self, screen-var + new-screen screen-ah, 5/width, 4/height + } + # var trace-ah/eax: (addr handle trace) <- get self, trace allocate trace-ah var trace/eax: (addr trace) <- lookup *trace-ah @@ -47,7 +57,7 @@ fn render-sandbox screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: var data/edx: (addr gap-buffer) <- copy _data var x/eax: int <- copy xmin var y/ecx: int <- copy ymin - y <- maybe-render-empty-screen screen, globals, xmin, y + y <- maybe-render-empty-screen screen, self, xmin, y var cursor-in-sandbox?/ebx: boolean <- copy 0/false { var cursor-in-trace?/eax: (addr boolean) <- get self, cursor-in-trace? @@ -78,7 +88,7 @@ fn render-sandbox screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: var dummy/eax: int <- draw-stream-rightward screen, value, x2, xmax, y, 7/fg=grey, 0/bg } y <- add 2 # padding - y <- maybe-render-screen screen, globals, xmin, y + y <- maybe-render-screen screen, self, xmin, y # render menu var cursor-in-trace?/eax: (addr boolean) <- get self, cursor-in-trace? compare *cursor-in-trace?, 0/false @@ -90,23 +100,15 @@ fn render-sandbox screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: render-sandbox-menu screen } -fn maybe-render-empty-screen screen: (addr screen), _globals: (addr global-table), xmin: int, ymin: int -> _/ecx: int { - var globals/esi: (addr global-table) <- copy _globals - var screen-literal-storage: (stream byte 8) - var screen-literal/eax: (addr stream byte) <- address screen-literal-storage - write screen-literal, "screen" - var screen-obj-index/ecx: int <- find-symbol-in-globals globals, screen-literal - compare screen-obj-index, -1/not-found +fn maybe-render-empty-screen screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int -> _/ecx: int { + var self/esi: (addr sandbox) <- copy _self + var screen-obj-cell-ah/eax: (addr handle cell) <- get self, screen-var + var screen-obj-cell/eax: (addr cell) <- lookup *screen-obj-cell-ah + compare screen-obj-cell, 0 { break-if-!= return ymin } - var global-data-ah/eax: (addr handle array global) <- get globals, data - var global-data/eax: (addr array global) <- lookup *global-data-ah - var screen-obj-offset/ecx: (offset global) <- compute-offset global-data, screen-obj-index - var screen-global/eax: (addr global) <- index global-data, screen-obj-offset - var screen-obj-cell-ah/eax: (addr handle cell) <- get screen-global, value - var screen-obj-cell/eax: (addr cell) <- lookup *screen-obj-cell-ah var screen-obj-cell-type/ecx: (addr int) <- get screen-obj-cell, type compare *screen-obj-cell-type, 5/screen { @@ -123,23 +125,15 @@ fn maybe-render-empty-screen screen: (addr screen), _globals: (addr global-table return y } -fn maybe-render-screen screen: (addr screen), _globals: (addr global-table), xmin: int, ymin: int -> _/ecx: int { - var globals/esi: (addr global-table) <- copy _globals - var screen-literal-storage: (stream byte 8) - var screen-literal/eax: (addr stream byte) <- address screen-literal-storage - write screen-literal, "screen" - var screen-obj-index/ecx: int <- find-symbol-in-globals globals, screen-literal - compare screen-obj-index, -1/not-found +fn maybe-render-screen screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int -> _/ecx: int { + var self/esi: (addr sandbox) <- copy _self + var screen-obj-cell-ah/eax: (addr handle cell) <- get self, screen-var + var screen-obj-cell/eax: (addr cell) <- lookup *screen-obj-cell-ah + compare screen-obj-cell, 0 { break-if-!= return ymin } - var global-data-ah/eax: (addr handle array global) <- get globals, data - var global-data/eax: (addr array global) <- lookup *global-data-ah - var screen-obj-offset/ecx: (offset global) <- compute-offset global-data, screen-obj-index - var screen-global/eax: (addr global) <- index global-data, screen-obj-offset - var screen-obj-cell-ah/eax: (addr handle cell) <- get screen-global, value - var screen-obj-cell/eax: (addr cell) <- lookup *screen-obj-cell-ah var screen-obj-cell-type/ecx: (addr int) <- get screen-obj-cell, type compare *screen-obj-cell-type, 5/screen { @@ -347,10 +341,12 @@ fn edit-sandbox _self: (addr sandbox), key: byte, globals: (addr global-table), var _value/eax: (addr stream byte) <- lookup *value-ah var value/edx: (addr stream byte) <- copy _value var trace-ah/eax: (addr handle trace) <- get self, trace - var trace/eax: (addr trace) <- lookup *trace-ah + var _trace/eax: (addr trace) <- lookup *trace-ah + var trace/ebx: (addr trace) <- copy _trace clear-trace trace - clear-screen-var globals - run data, value, globals, trace + var screen-cell/eax: (addr handle cell) <- get self, screen-var + clear-screen-cell screen-cell + run data, value, globals, trace, screen-cell return } # tab @@ -385,7 +381,7 @@ fn edit-sandbox _self: (addr sandbox), key: byte, globals: (addr global-table), return } -fn run in: (addr gap-buffer), out: (addr stream byte), globals: (addr global-table), trace: (addr trace) { +fn run in: (addr gap-buffer), out: (addr stream byte), globals: (addr global-table), trace: (addr trace), screen-cell: (addr handle cell) { var read-result-storage: (handle cell) var read-result/esi: (addr handle cell) <- address read-result-storage read-cell in, read-result, trace @@ -400,7 +396,7 @@ fn run in: (addr gap-buffer), out: (addr stream byte), globals: (addr global-tab allocate-pair nil-ah var eval-result-storage: (handle cell) var eval-result/edi: (addr handle cell) <- address eval-result-storage - evaluate read-result, eval-result, *nil-ah, globals, trace + evaluate read-result, eval-result, *nil-ah, globals, trace, screen-cell var error?/eax: boolean <- has-errors? trace { compare error?, 0/false @@ -415,7 +411,7 @@ fn run in: (addr gap-buffer), out: (addr stream byte), globals: (addr global-tab fn test-run-integer { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage - initialize-sandbox sandbox + initialize-sandbox sandbox, 0/no-screen # type "1" edit-sandbox sandbox, 0x31/1, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk # eval @@ -434,7 +430,7 @@ fn test-run-integer { fn test-run-with-spaces { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage - initialize-sandbox sandbox + initialize-sandbox sandbox, 0/no-screen # type input with whitespace before and after edit-sandbox sandbox, 0x20/space, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk edit-sandbox sandbox, 0x31/1, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk @@ -457,7 +453,7 @@ fn test-run-with-spaces { fn test-run-quote { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage - initialize-sandbox sandbox + initialize-sandbox sandbox, 0/no-screen # type "'a" edit-sandbox sandbox, 0x27/quote, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk edit-sandbox sandbox, 0x61/a, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk @@ -477,7 +473,7 @@ fn test-run-quote { fn test-run-error-invalid-integer { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage - initialize-sandbox sandbox + initialize-sandbox sandbox, 0/no-screen # type "1a" edit-sandbox sandbox, 0x31/1, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk edit-sandbox sandbox, 0x61/a, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk @@ -497,7 +493,7 @@ fn test-run-error-invalid-integer { fn test-run-move-cursor-into-trace { var sandbox-storage: sandbox var sandbox/esi: (addr sandbox) <- address sandbox-storage - initialize-sandbox sandbox + initialize-sandbox sandbox, 0/no-screen # type "12" edit-sandbox sandbox, 0x31/1, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk edit-sandbox sandbox, 0x32/2, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk |