diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-11-21 10:01:12 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-11-21 10:04:38 -0800 |
commit | 3f7eed6c600d6fb10ad6ae279f87541af69af9a2 (patch) | |
tree | 5b39a6c193697fd86746873d1252e180edbc43f7 /edit | |
parent | 167d0ca0d62f46598ea7385a11fa64ec935b5269 (diff) | |
download | mu-3f7eed6c600d6fb10ad6ae279f87541af69af9a2.tar.gz |
2467 - rename 'string' to 'text' everywhere
Not entirely happy with this. Maybe we'll find a better name. But at least it's an improvement. One part I *am* happy with is renaming string-replace to replace, string-append to append, etc. Overdue, now that we have static dispatch.
Diffstat (limited to 'edit')
-rw-r--r-- | edit/001-editor.mu | 4 | ||||
-rw-r--r-- | edit/004-programming-environment.mu | 14 | ||||
-rw-r--r-- | edit/005-sandbox.mu | 16 | ||||
-rw-r--r-- | edit/008-sandbox-test.mu | 6 | ||||
-rw-r--r-- | edit/009-sandbox-trace.mu | 2 | ||||
-rw-r--r-- | edit/010-warnings.mu | 6 |
6 files changed, 24 insertions, 24 deletions
diff --git a/edit/001-editor.mu b/edit/001-editor.mu index ae9e5219..f84e388a 100644 --- a/edit/001-editor.mu +++ b/edit/001-editor.mu @@ -1,6 +1,6 @@ ## the basic editor data structure, and how it displays text to the screen -# temporary main for this layer: just render the given string at the given +# temporary main for this layer: just render the given text at the given # screen dimensions, then stop recipe! main text:address:array:character [ local-scope @@ -13,7 +13,7 @@ recipe! main text:address:array:character [ close-console ] -scenario editor-initially-prints-string-to-screen [ +scenario editor-initially-prints-text-to-screen [ assume-screen 10/width, 5/height run [ 1:address:array:character <- new [abc] diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu index 0915fb33..51dd2362 100644 --- a/edit/004-programming-environment.mu +++ b/edit/004-programming-environment.mu @@ -34,7 +34,7 @@ recipe new-programming-environment screen:address:screen, initial-recipe-content assert button-on-screen?, [screen too narrow for menu] screen <- move-cursor screen, 0/row, button-start run-button:address:array:character <- new [ run (F4) ] - print-string screen, run-button, 255/white, 161/reddish + print screen, run-button, 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 @@ -381,7 +381,7 @@ recipe render-all screen:address:screen, env:address:programming-environment-dat assert button-on-screen?, [screen too narrow for menu] screen <- move-cursor screen, 0/row, button-start run-button:address:array:character <- new [ run (F4) ] - print-string screen, run-button, 255/white, 161/reddish + print screen, run-button, 255/white, 161/reddish # dotted line down the middle trace 11, [app], [render divider] divider:number, _ <- divide-with-remainder width, 2 @@ -450,9 +450,9 @@ recipe update-cursor screen:address:screen, recipes:address:editor-data, current screen <- move-cursor screen, cursor-row, cursor-column ] -# print a string 's' to 'editor' in 'color' starting at 'row' +# print a text 's' to 'editor' in 'color' starting at 'row' # clear rest of last line, move cursor to next line -recipe render-string screen:address:screen, s:address:array:character, left:number, right:number, color:number, row:number -> row:number, screen:address:screen [ +recipe render screen:address:screen, s:address:array:character, left:number, right:number, color:number, row:number -> row:number, screen:address:screen [ local-scope load-ingredients reply-unless s @@ -510,8 +510,8 @@ recipe render-string screen:address:screen, s:address:array:character, left:numb move-cursor screen, row, left ] -# like 'render-string' but with colorization for comments like in the editor -recipe render-code-string screen:address:screen, s:address:array:character, left:number, right:number, row:number -> row:number, screen:address:screen [ +# like 'render' for texts, but with colorization for comments like in the editor +recipe render-code screen:address:screen, s:address:array:character, left:number, right:number, row:number -> row:number, screen:address:screen [ local-scope load-ingredients reply-unless s @@ -528,7 +528,7 @@ recipe render-code-string screen:address:screen, s:address:array:character, left done? <- greater-or-equal row, screen-height break-if done? c:character <- index *s, i - <character-c-received> # only line different from render-string + <character-c-received> # only line different from render { # at right? wrap. at-right?:boolean <- equal column, right diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu index d6e8b8a4..bb34de1b 100644 --- a/edit/005-sandbox.mu +++ b/edit/005-sandbox.mu @@ -194,7 +194,7 @@ recipe update-status screen:address:screen, msg:address:array:character, color:n local-scope load-ingredients screen <- move-cursor screen, 0, 2 - screen <- print-string screen, msg, color, 238/grey/background + screen <- print screen, msg, color, 238/grey/background ] recipe save-sandboxes env:address:programming-environment-data [ @@ -209,12 +209,12 @@ recipe save-sandboxes env:address:programming-environment-data [ { break-unless curr data:address:array:character <- get *curr, data:offset - filename:address:array:character <- integer-to-decimal-string idx + filename:address:array:character <- integer-to-decimal-text idx save filename, data { expected-response:address:array:character <- get *curr, expected-response:offset break-unless expected-response - filename <- string-append filename, suffix + filename <- append filename, suffix save filename, expected-response } idx <- add idx, 1 @@ -258,7 +258,7 @@ recipe render-sandboxes screen:address:screen, sandbox:address:sandbox-data, lef row <- add row, 1 screen <- move-cursor screen, row, left sandbox-data:address:array:character <- get *sandbox, data:offset - row, screen <- render-code-string screen, sandbox-data, left, right, row + row, screen <- render-code screen, sandbox-data, left, right, row 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 @@ -275,7 +275,7 @@ recipe render-sandboxes screen:address:screen, sandbox:address:sandbox-data, lef break-unless empty-screen? *response-starting-row <- copy row <render-sandbox-response> - row, screen <- render-string screen, sandbox-response, left, right, 245/grey, row + row, screen <- render screen, sandbox-response, left, right, 245/grey, row } +render-sandbox-end at-bottom?:boolean <- greater-or-equal row, screen-height @@ -296,7 +296,7 @@ recipe restore-sandboxes env:address:programming-environment-data -> env:address idx:number <- copy 0 curr:address:address:sandbox-data <- get-address *env, sandbox:offset { - filename:address:array:character <- integer-to-decimal-string idx + filename:address:array:character <- integer-to-decimal-text idx contents:address:array:character <- restore filename break-unless contents # stop at first error; assuming file didn't exist # create new sandbox for file @@ -305,7 +305,7 @@ recipe restore-sandboxes env:address:programming-environment-data -> env:address *data <- copy contents # restore expected output for sandbox if it exists { - filename <- string-append filename, suffix + filename <- append filename, suffix contents <- restore filename break-unless contents expected-response:address:address:array:character <- get-address **curr, expected-response:offset @@ -326,7 +326,7 @@ recipe render-screen screen:address:screen, sandbox-screen:address:screen, left: reply-unless sandbox-screen # print 'screen:' header:address:array:character <- new [screen:] - row <- render-string screen, header, left, right, 245/grey, row + row <- render screen, header, 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 2c557c17..6c3c4acd 100644 --- a/edit/008-sandbox-test.mu +++ b/edit/008-sandbox-test.mu @@ -157,14 +157,14 @@ after <render-sandbox-response> [ break-unless sandbox-response expected-response:address:array:character <- get *sandbox, expected-response:offset break-unless expected-response # fall-through to print in grey - response-is-expected?:boolean <- string-equal expected-response, sandbox-response + response-is-expected?:boolean <- text-equal expected-response, sandbox-response { break-if response-is-expected?:boolean - row, screen <- render-string screen, sandbox-response, left, right, 1/red, row + row, screen <- render screen, sandbox-response, left, right, 1/red, row } { break-unless response-is-expected?:boolean - row, screen <- render-string screen, sandbox-response, left, right, 2/green, row + row, screen <- render screen, sandbox-response, left, right, 2/green, row } jump +render-sandbox-end:label } diff --git a/edit/009-sandbox-trace.mu b/edit/009-sandbox-trace.mu index a67dc999..10e34c9c 100644 --- a/edit/009-sandbox-trace.mu +++ b/edit/009-sandbox-trace.mu @@ -203,7 +203,7 @@ after <render-sandbox-results> [ break-unless display-trace? sandbox-trace:address:array:character <- get *sandbox, trace:offset break-unless sandbox-trace # nothing to print; move on - row, screen <- render-string, screen, sandbox-trace, left, right, 245/grey, row + row, screen <- render screen, sandbox-trace, left, right, 245/grey, row } <render-sandbox-trace-done> ] diff --git a/edit/010-warnings.mu b/edit/010-warnings.mu index b84a512c..4a04d73d 100644 --- a/edit/010-warnings.mu +++ b/edit/010-warnings.mu @@ -38,7 +38,7 @@ before <render-recipe-components-end> [ { recipe-warnings:address:array:character <- get *env, recipe-warnings:offset break-unless recipe-warnings - row, screen <- render-string screen, recipe-warnings, left, right, 1/red, row + row, screen <- render screen, recipe-warnings, left, right, 1/red, row } ] @@ -71,7 +71,7 @@ after <render-sandbox-trace-done> [ sandbox-warnings:address:array:character <- get *sandbox, warnings:offset break-unless sandbox-warnings *response-starting-row <- copy 0 # no response - row, screen <- render-string screen, sandbox-warnings, left, right, 1/red, row + row, screen <- render screen, sandbox-warnings, left, right, 1/red, row # don't try to print anything more for this sandbox jump +render-sandbox-end:label } @@ -232,7 +232,7 @@ scenario run-shows-unbalanced-bracket-warnings [ recipe foo « x <- copy 0 ] - string-replace 1:address:array:character, 171/«, 91 # '[' + replace 1:address:array:character, 171/«, 91 # '[' 2:address:array:character <- new [foo] 3:address:programming-environment-data <- new-programming-environment screen:address:screen, 1:address:array:character, 2:address:array:character assume-console [ |