diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-01-28 02:31:54 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-01-28 02:31:54 -0800 |
commit | 4d174c5ad56ce4aa11597efee01aca2e25440ffa (patch) | |
tree | f4275dc645170208ec1dbc91bba0fc41b7ccd1fb | |
parent | 00662ce27a133e086e06d821608c7d53f2a7eab8 (diff) | |
download | mu-4d174c5ad56ce4aa11597efee01aca2e25440ffa.tar.gz |
660
Yet another 'grow-buffer' bug.
-rw-r--r-- | color-repl.mu | 4 | ||||
-rw-r--r-- | mu.arc | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/color-repl.mu b/color-repl.mu index f086ddf5..5804e25b 100644 --- a/color-repl.mu +++ b/color-repl.mu @@ -7,7 +7,7 @@ (function read-sexp [ (default-space:space-address <- new space:literal 30:literal) - (result:buffer-address <- init-buffer 30:literal) + (result:buffer-address <- init-buffer 3:literal) (open-parens:integer <- copy 0:literal) ; for balancing parens and tracking nesting depth ; we can change color when backspacing over parens or comments or strings, ; but we need to know that they aren't escaped @@ -100,6 +100,7 @@ (color-code:integer <- add color-code:integer 1:literal) ($print-key-to-host c:character color-code:integer) (open-parens:integer <- add open-parens:integer 1:literal) +;? (print-primitive-to-host open-parens:integer) ;? 1 (jump next-key:offset) } { begin @@ -109,6 +110,7 @@ (_ color-code:integer <- divide-with-remainder open-parens:integer 3:literal) ; 3 distinct colors for parens (color-code:integer <- add color-code:integer 1:literal) ($print-key-to-host c:character color-code:integer) +;? (print-primitive-to-host open-parens:integer) ;? 1 (jump next-key:offset) } { begin diff --git a/mu.arc b/mu.arc index cc6d67c6..fd6812a4 100644 --- a/mu.arc +++ b/mu.arc @@ -821,6 +821,9 @@ ) $eval (new-string:repr:eval:read:to-arc-string (m arg.0)) +;? (let x (to-arc-string (m arg.0)) ;? 1 +;? (prn x) ;? 1 +;? (new-string:repr:eval x)) ;? 1 ; user-defined functions next-input @@ -2327,7 +2330,9 @@ ; double buffer size (x:string-address-address <- get-address in:buffer-address/deref data:offset) (oldlen:integer <- length x:string-address-address/deref/deref) +;? (print-primitive-to-host oldlen:integer) ;? 1 (newlen:integer <- multiply oldlen:integer 2:literal) +;? (print-primitive-to-host newlen:integer) ;? 1 (olddata:string-address <- copy x:string-address-address/deref) (x:string-address-address/deref <- new string:literal newlen:integer) ; copy old contents @@ -2337,7 +2342,7 @@ (break-if done?:boolean) (src:byte <- index olddata:string-address/deref i:integer) (dest:byte-address <- index-address x:string-address-address/deref/deref i:integer) - (dest:byte-address <- copy src:byte) + (dest:byte-address/deref <- copy src:byte) (i:integer <- add i:integer 1:literal) (loop) } |