From d409be9b29b4bbfdf10fa26620fa6abbe45a87da Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 20 Oct 2020 23:06:24 -0700 Subject: 7088 --- html/apps/tile/gap-buffer.mu.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'html/apps/tile/gap-buffer.mu.html') diff --git a/html/apps/tile/gap-buffer.mu.html b/html/apps/tile/gap-buffer.mu.html index 02c71b8f..886487ed 100644 --- a/html/apps/tile/gap-buffer.mu.html +++ b/html/apps/tile/gap-buffer.mu.html @@ -347,6 +347,34 @@ if ('onhashchange' in window) { 288 var result/eax: int <- copy _result 289 check-ints-equal result, 1, "F - test-gap-buffer-equal-from-start?" 290 } +291 +292 fn copy-gap-buffer _src-ah: (addr handle gap-buffer), _dest-ah: (addr handle gap-buffer) { +293 # obtain src-a, dest-a +294 var src-ah/eax: (addr handle gap-buffer) <- copy _src-ah +295 var _src-a/eax: (addr gap-buffer) <- lookup *src-ah +296 var src-a/esi: (addr gap-buffer) <- copy _src-a +297 var dest-ah/eax: (addr handle gap-buffer) <- copy _dest-ah +298 var _dest-a/eax: (addr gap-buffer) <- lookup *dest-ah +299 var dest-a/edi: (addr gap-buffer) <- copy _dest-a +300 # copy left grapheme-stack +301 var src/ecx: (addr grapheme-stack) <- get src-a, left +302 var dest/edx: (addr grapheme-stack) <- get dest-a, left +303 copy-grapheme-stack src, dest +304 # copy right grapheme-stack +305 src <- get src-a, right +306 dest <- get dest-a, right +307 copy-grapheme-stack src, dest +308 } +309 +310 fn gap-buffer-is-decimal-integer? _self: (addr gap-buffer) -> result/eax: boolean { +311 var self/esi: (addr gap-buffer) <- copy _self +312 var curr/ecx: (addr grapheme-stack) <- get self, left +313 result <- grapheme-stack-is-decimal-integer? curr +314 compare result, 0 # false +315 break-if-= +316 curr <- get self, right +317 result <- grapheme-stack-is-decimal-integer? curr +318 } -- cgit 1.4.1-2-gfad0