diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2014-11-01 02:32:39 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2014-11-01 02:32:39 -0700 |
commit | a8a1786bada82217c4289c236ea54c651b0eefce (patch) | |
tree | 684ab694f4283d7282eb92e130f4b3e9144749bb | |
parent | 4da62e4ac325e45ae0dbd09e38b9dfcfcd78c1ae (diff) | |
download | mu-a8a1786bada82217c4289c236ea54c651b0eefce.tar.gz |
202 - variable names for edit.mu
-rw-r--r-- | edit.arc.t | 12 | ||||
-rw-r--r-- | edit.mu | 23 |
2 files changed, 13 insertions, 22 deletions
diff --git a/edit.arc.t b/edit.arc.t index 402a4265..279e7188 100644 --- a/edit.arc.t +++ b/edit.arc.t @@ -2,7 +2,6 @@ (reset) (new-trace "new-screen") -;? (set dump-trace*) (add-fns:readfile "edit.mu") (add-fns '((test-new-screen @@ -11,10 +10,9 @@ ;? (each stmt function*!new-screen ;? (prn stmt)) (let before Memory-in-use-until +;? (= dump-trace* (obj blacklist '("sz" "m" "setm" "addr" "cvt0" "cvt1"))) (run 'test-new-screen) ;? (prn memory*) - (when (~is (- Memory-in-use-until before) 36) ; 5+1 * 5+1 - (prn "F - new-screen didn't allocate enough memory: @(- Memory-in-use-until before)")) ;? (prn memory*!2001) (when (~is (memory* memory*!2001) 5) ; number of rows (prn "F - newly-allocated screen doesn't have the right number of rows: @(memory* memory*!2001)")) @@ -23,14 +21,6 @@ ;? (prn row-pointers) (when (some nil (map memory* row-pointers)) (prn "F - newly-allocated screen didn't initialize all of its row pointers")) -;? (when (~iso (prn:map memory* row-pointers) - (when (~iso (map memory* row-pointers) - (list (+ before 6) - (+ before 12) - (+ before 18) - (+ before 24) - (+ before 30))) - (prn "F - newly-allocated screen incorrectly initialized its row pointers")) (when (~all 5 (map memory* (map memory* row-pointers))) (prn "F - newly-allocated screen didn't initialize all of its row lengths")))) diff --git a/edit.mu b/edit.mu index be32f943..1a72f032 100644 --- a/edit.mu +++ b/edit.mu @@ -1,17 +1,18 @@ ; a screen is an array of pointers to lines, in turn arrays of characters (new-screen - ((601 integer) <- arg) - ((602 integer) <- arg) - ((603 screen-address) <- new (screen literal) (601 integer)) - ((604 integer) <- copy (0 literal)) + ((default-scope scope-address) <- new (scope literal) (30 literal)) + ((nrows integer) <- arg) + ((ncols integer) <- arg) + ((result screen-address) <- new (screen literal) (nrows integer)) + ((rowidx integer) <- copy (0 literal)) { begin - ((606 line-address-address) <- index-address (603 screen-address deref) (604 integer)) - ((606 line-address-address deref) <- new (line literal) (602 integer)) - ((605 line-address) <- copy (606 line-address-address deref)) - ((604 integer) <- add (604 integer) (1 literal)) - ((607 boolean) <- neq (604 integer) (601 integer)) - (continue-if (607 boolean)) + ((curr-line-address-address line-address-address) <- index-address (result screen-address deref) (rowidx integer)) + ((curr-line-address-address line-address-address deref) <- new (line literal) (ncols integer)) + ((curr-line-address line-address) <- copy (curr-line-address-address line-address-address deref)) + ((rowidx integer) <- add (rowidx integer) (1 literal)) + ((x boolean) <- neq (rowidx integer) (nrows integer)) + (continue-if (x boolean)) } - (reply (603 screen-address)) + (reply (result screen-address)) ) |