diff options
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/005-sandbox.mu | 9 | ||||
-rw-r--r-- | sandbox/008-sandbox-test.mu | 13 | ||||
-rw-r--r-- | sandbox/010-warnings.mu | 1 |
3 files changed, 17 insertions, 6 deletions
diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu index 929716a1..690ab22c 100644 --- a/sandbox/005-sandbox.mu +++ b/sandbox/005-sandbox.mu @@ -23,7 +23,6 @@ container sandbox-data [ # constraint: will be 0 for sandboxes at positions before env.render-from starting-row-on-screen:number code-ending-row-on-screen:number # past end of code - response-starting-row-on-screen:number screen:address:shared:screen # prints in the sandbox go here next-sandbox:address:shared:sandbox-data ] @@ -289,7 +288,6 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san code-ending-row:address:number <- get-address *sandbox, code-ending-row-on-screen:offset *code-ending-row <- copy row # render sandbox warnings, screen or response, in that order - response-starting-row:address:number <- get-address *sandbox, response-starting-row-on-screen:offset sandbox-response:address:shared:array:character <- get *sandbox, response:offset <render-sandbox-results> { @@ -300,13 +298,12 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san } { break-unless empty-screen? - *response-starting-row <- copy row <render-sandbox-response> row, screen <- render screen, sandbox-response, left, right, 245/grey, row } +render-sandbox-end at-bottom?:boolean <- greater-or-equal row, screen-height - reply-if at-bottom?, row/same-as-ingredient:4, screen/same-as-ingredient:0 + reply-if at-bottom? # draw solid line after sandbox draw-horizontal screen, row, left, right, 9473/horizontal-double } @@ -317,8 +314,7 @@ recipe render-sandboxes screen:address:shared:screen, sandbox:address:shared:san *tmp <- copy 0 tmp:address:number <- get-address *sandbox, code-ending-row-on-screen:offset *tmp <- copy 0 - tmp:address:number <- get-address *sandbox, response-starting-row-on-screen:offset - *tmp <- copy 0 + <end-render-sandbox-reset-hidden> } # draw next sandbox next-sandbox:address:shared:sandbox-data <- get *sandbox, next-sandbox:offset @@ -429,6 +425,7 @@ recipe render-screen screen:address:shared:screen, sandbox-screen:address:shared ] scenario run-updates-results [ + trace-until 100/app # trace too long assume-screen 50/width, 12/height # define a recipe (no indent for the 'add' line below so column numbers are more obvious) 1:address:shared:array:character <- new [ diff --git a/sandbox/008-sandbox-test.mu b/sandbox/008-sandbox-test.mu index d08bb890..c5695610 100644 --- a/sandbox/008-sandbox-test.mu +++ b/sandbox/008-sandbox-test.mu @@ -110,6 +110,11 @@ after <global-touch> [ } ] +# this requires tracking where responses begin for every sandbox +container sandbox-data [ + response-starting-row-on-screen:number +] + recipe find-click-in-sandbox-output env:address:shared:programming-environment-data, click-row:number -> sandbox:address:shared:sandbox-data [ local-scope load-ingredients @@ -155,6 +160,8 @@ recipe toggle-expected-response sandbox:address:shared:sandbox-data -> sandbox:a after <render-sandbox-response> [ { break-unless sandbox-response + response-starting-row:address:number <- get-address *sandbox, response-starting-row-on-screen:offset + *response-starting-row <- copy row expected-response:address:shared:array:character <- get *sandbox, expected-response:offset break-unless expected-response # fall-through to print in grey response-is-expected?:boolean <- equal expected-response, sandbox-response @@ -169,3 +176,9 @@ after <render-sandbox-response> [ jump +render-sandbox-end:label } ] + +before <end-render-sandbox-reset-hidden> [ + $log sandbox, [resetting response starting row] + tmp:address:number <- get-address *sandbox, response-starting-row-on-screen:offset + *tmp <- copy 0 +] diff --git a/sandbox/010-warnings.mu b/sandbox/010-warnings.mu index a20e306d..8ceb88bb 100644 --- a/sandbox/010-warnings.mu +++ b/sandbox/010-warnings.mu @@ -118,6 +118,7 @@ after <render-sandbox-trace-done> [ { sandbox-warnings:address:shared:array:character <- get *sandbox, warnings:offset break-unless sandbox-warnings + response-starting-row:address:number <- get-address *sandbox, response-starting-row-on-screen:offset *response-starting-row <- copy 0 # no response { break-unless env |