diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-04-14 15:26:04 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-04-14 15:26:04 -0700 |
commit | 76fb62a16d4db597cc6a5aad5c99759b0b8fdc0e (patch) | |
tree | 5c9d7ac9b7ffe4a0459d344fd99f444f9841e669 /shell | |
parent | bbabe8bd1a727c8ea971d759241ad0b7b98bc8d8 (diff) | |
download | mu-76fb62a16d4db597cc6a5aad5c99759b0b8fdc0e.tar.gz |
.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/gap-buffer.mu | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/gap-buffer.mu b/shell/gap-buffer.mu index b04c072c..25f4c9b8 100644 --- a/shell/gap-buffer.mu +++ b/shell/gap-buffer.mu @@ -8,12 +8,12 @@ type gap-buffer { right-read-index: int } -fn initialize-gap-buffer _self: (addr gap-buffer), max-word-size: int { +fn initialize-gap-buffer _self: (addr gap-buffer), capacity: int { var self/esi: (addr gap-buffer) <- copy _self var left/eax: (addr grapheme-stack) <- get self, left - initialize-grapheme-stack left, max-word-size + initialize-grapheme-stack left, capacity var right/eax: (addr grapheme-stack) <- get self, right - initialize-grapheme-stack right, max-word-size + initialize-grapheme-stack right, capacity } fn clear-gap-buffer _self: (addr gap-buffer) { @@ -26,8 +26,8 @@ fn clear-gap-buffer _self: (addr gap-buffer) { # just for tests fn initialize-gap-buffer-with self: (addr gap-buffer), s: (addr array byte) { - initialize-gap-buffer self, 0x10/max-word-size - var stream-storage: (stream byte 0x10/max-word-size) + initialize-gap-buffer self, 0x10/capacity + var stream-storage: (stream byte 0x10/capacity) var stream/ecx: (addr stream byte) <- address stream-storage write stream, s { @@ -278,7 +278,7 @@ fn gap-buffer-equal? _self: (addr gap-buffer), s: (addr array byte) -> _/eax: bo # complication: graphemes may be multiple bytes # so don't rely on length # instead turn the expected result into a stream and arrange to read from it in order - var stream-storage: (stream byte 0x10/max-word-size) + var stream-storage: (stream byte 0x10/capacity) var expected-stream/ecx: (addr stream byte) <- address stream-storage write expected-stream, s # compare left |