diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-10-17 23:29:02 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-10-17 23:29:02 -0700 |
commit | dc0e03e4a52adf914d8ed55ca5f833947cc264d3 (patch) | |
tree | 59561ea097071cb776b583d2e2479ae7f14f45c5 /apps/tile/grapheme-stack.mu | |
parent | 1fc218bf9d274d739d37284a58fec61c283ee33f (diff) | |
download | mu-dc0e03e4a52adf914d8ed55ca5f833947cc264d3.tar.gz |
7053
Rename seems to now be working. State still isn't rendered right, so we can't be sure.
Diffstat (limited to 'apps/tile/grapheme-stack.mu')
-rw-r--r-- | apps/tile/grapheme-stack.mu | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/tile/grapheme-stack.mu b/apps/tile/grapheme-stack.mu index 2b7c8a87..401dda2d 100644 --- a/apps/tile/grapheme-stack.mu +++ b/apps/tile/grapheme-stack.mu @@ -11,14 +11,20 @@ fn initialize-grapheme-stack _self: (addr grapheme-stack), n: int { copy-to *top, 0 } +fn clear-grapheme-stack _self: (addr grapheme-stack) { + var self/esi: (addr grapheme-stack) <- copy _self + var top/eax: (addr int) <- get self, top + copy-to *top, 0 +} + fn grapheme-stack-empty? _self: (addr grapheme-stack) -> result/eax: boolean { $grapheme-stack-empty?:body: { var self/esi: (addr grapheme-stack) <- copy _self var top/eax: (addr int) <- get self, top compare *top, 0 { - break-if-= - result <- copy 1 # false + break-if-!= + result <- copy 1 # true break $grapheme-stack-empty?:body } result <- copy 0 # false |