diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-03-14 13:00:21 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-03-14 13:00:21 -0700 |
commit | 44bab2e4b4c8252b20c848108fa7bf9e33e2b26a (patch) | |
tree | 59312503c564a69b33105fe5801e5f79db65587e /edit | |
parent | 3c393fd2449ebdd362f39873106199f089ed6718 (diff) | |
download | mu-44bab2e4b4c8252b20c848108fa7bf9e33e2b26a.tar.gz |
2782 - directly use string literals everywhere
Diffstat (limited to 'edit')
-rw-r--r-- | edit/004-programming-environment.mu | 6 | ||||
-rw-r--r-- | edit/005-sandbox.mu | 13 | ||||
-rw-r--r-- | edit/008-sandbox-test.mu | 2 | ||||
-rw-r--r-- | edit/010-errors.mu | 9 |
4 files changed, 10 insertions, 20 deletions
diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu index e8ff90d8..f43a44a7 100644 --- a/edit/004-programming-environment.mu +++ b/edit/004-programming-environment.mu @@ -33,8 +33,7 @@ def new-programming-environment screen:address:shared:screen, initial-recipe-con button-on-screen?:boolean <- greater-or-equal button-start, 0 assert button-on-screen?, [screen too narrow for menu] screen <- move-cursor screen, 0/row, button-start - run-button:address:shared:array:character <- new [ run (F4) ] - print screen, run-button, 255/white, 161/reddish + print screen, [ run (F4) ], 255/white, 161/reddish # dotted line down the middle divider:number, _ <- divide-with-remainder width, 2 draw-vertical screen, divider, 1/top, height, 9482/vertical-dotted @@ -385,8 +384,7 @@ def render-all screen:address:shared:screen, env:address:shared:programming-envi button-on-screen?:boolean <- greater-or-equal button-start, 0 assert button-on-screen?, [screen too narrow for menu] screen <- move-cursor screen, 0/row, button-start - run-button:address:shared:array:character <- new [ run (F4) ] - print screen, run-button, 255/white, 161/reddish + print screen, [ run (F4) ], 255/white, 161/reddish # dotted line down the middle trace 11, [app], [render divider] divider:number, _ <- divide-with-remainder width, 2 diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu index 361a346f..95cc53b8 100644 --- a/edit/005-sandbox.mu +++ b/edit/005-sandbox.mu @@ -127,15 +127,13 @@ after <global-keypress> [ { do-run?:boolean <- equal *k, 65532/F4 break-unless do-run? - status:address:shared:array:character <- new [running... ] - screen <- update-status screen, status, 245/grey + screen <- update-status screen, [running... ], 245/grey error?:boolean, env, screen <- run-sandboxes env, screen # F4 might update warnings and results on both sides screen <- render-all screen, env { break-if error? - status:address:shared:array:character <- new [ ] - screen <- update-status screen, status, 245/grey + screen <- update-status screen, [ ], 245/grey } screen <- update-cursor screen, recipes, current-sandbox, *sandbox-in-focus?, env loop +next-event:label @@ -223,7 +221,6 @@ def save-sandboxes env:address:shared:programming-environment-data [ # first clear previous versions, in case we deleted some sandbox $system [rm lesson/[0-9]* >/dev/null 2>/dev/null] # some shells can't handle '>&' curr:address:shared:sandbox-data <- get *env, sandbox:offset - suffix:address:shared:array:character <- new [.out] idx:number <- copy 0 { break-unless curr @@ -328,7 +325,6 @@ def restore-sandboxes env:address:shared:programming-environment-data -> env:add local-scope load-ingredients # read all scenarios, pushing them to end of a list of scenarios - suffix:address:shared:array:character <- new [.out] idx:number <- copy 0 curr:address:address:shared:sandbox-data <- get-address *env, sandbox:offset { @@ -341,7 +337,7 @@ def restore-sandboxes env:address:shared:programming-environment-data -> env:add *data <- copy contents # restore expected output for sandbox if it exists { - filename <- append filename, suffix + filename <- append filename, [.out] contents <- restore filename break-unless contents <end-restore-sandbox> @@ -363,8 +359,7 @@ def render-screen screen:address:shared:screen, sandbox-screen:address:shared:sc load-ingredients return-unless sandbox-screen # print 'screen:' - header:address:shared:array:character <- new [screen:] - row <- render screen, header, left, right, 245/grey, row + row <- render screen, [screen:], left, right, 245/grey, row screen <- move-cursor screen, row, left # start printing sandbox-screen column:number <- copy left diff --git a/edit/008-sandbox-test.mu b/edit/008-sandbox-test.mu index a3311891..7d479375 100644 --- a/edit/008-sandbox-test.mu +++ b/edit/008-sandbox-test.mu @@ -93,7 +93,7 @@ before <end-save-sandbox> [ { expected-response:address:shared:array:character <- get *curr, expected-response:offset break-unless expected-response - filename <- append filename, suffix + filename <- append filename, [.out] save filename, expected-response } ] diff --git a/edit/010-errors.mu b/edit/010-errors.mu index d913302c..1a0dc812 100644 --- a/edit/010-errors.mu +++ b/edit/010-errors.mu @@ -16,8 +16,7 @@ def! update-recipes env:address:shared:programming-environment-data, screen:addr # if recipe editor has errors, stop { break-unless *recipe-errors - status:address:shared:array:character <- new [errors found ] - update-status screen, status, 1/red + update-status screen, [errors found ], 1/red errors-found? <- copy 1/true return } @@ -29,8 +28,7 @@ before <render-components-end> [ recipe-errors:address:shared:array:character <- get *env, recipe-errors:offset { break-unless recipe-errors - status:address:shared:array:character <- new [errors found ] - update-status screen, status, 1/red + update-status screen, [errors found ], 1/red } ] @@ -70,9 +68,8 @@ before <render-components-end> [ error-index:number <- get *env, error-index:offset sandboxes-completed-successfully?:boolean <- equal error-index, -1 break-if sandboxes-completed-successfully? - status-template:address:shared:array:character <- new [errors found (_) ] error-index-text:address:shared:array:character <- to-text error-index - status:address:shared:array:character <- interpolate status-template, error-index-text + status:address:shared:array:character <- interpolate [errors found (_) ], error-index-text update-status screen, status, 1/red } ] |