From 3ff2fe607c2cb5690d201d3b83ddcc957e949b7a Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 9 Nov 2021 09:23:31 -0800 Subject: . --- html/linux/tile/grapheme-stack.mu.html | 132 ++++++++++++++++----------------- 1 file changed, 66 insertions(+), 66 deletions(-) (limited to 'html/linux/tile/grapheme-stack.mu.html') diff --git a/html/linux/tile/grapheme-stack.mu.html b/html/linux/tile/grapheme-stack.mu.html index 09c487b4..d5a29921 100644 --- a/html/linux/tile/grapheme-stack.mu.html +++ b/html/linux/tile/grapheme-stack.mu.html @@ -16,16 +16,16 @@ a { color:inherit; } * { font-size:12pt; font-size: 1em; } .PreProc { color: #c000c0; } .muRegEbx { color: #5f00ff; } -.muRegEcx { color: #870000; } .muRegEdx { color: #af5f00; } .LineNr { } +.Constant { color: #008787; } +.muComment { color: #005faf; } .muRegEsi { color: #005faf; } .muRegEdi { color: #00af00; } -.Constant { color: #008787; } -.muFunction { color: #af5f00; text-decoration: underline; } +.muRegEcx { color: #870000; } .Delimiter { color: #c000c0; } +.muFunction { color: #af5f00; text-decoration: underline; } .Special { color: #ff6060; } -.muComment { color: #005faf; } --> @@ -61,27 +61,27 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/main/linux/tile/grapheme-stack.mu
-  1 type grapheme-stack {
-  2   data: (handle array grapheme)
+  1 type code-point-utf8-stack {
+  2   data: (handle array code-point-utf8)
   3   top: int
   4 }
   5 
-  6 fn initialize-grapheme-stack _self: (addr grapheme-stack), n: int {
-  7   var self/esi: (addr grapheme-stack) <- copy _self
-  8   var d/edi: (addr handle array grapheme) <- get self, data
+  6 fn initialize-code-point-utf8-stack _self: (addr code-point-utf8-stack), n: int {
+  7   var self/esi: (addr code-point-utf8-stack) <- copy _self
+  8   var d/edi: (addr handle array code-point-utf8) <- get self, data
   9   populate d, n
  10   var top/eax: (addr int) <- get self, top
  11   copy-to *top, 0
  12 }
  13 
- 14 fn clear-grapheme-stack _self: (addr grapheme-stack) {
- 15   var self/esi: (addr grapheme-stack) <- copy _self
+ 14 fn clear-code-point-utf8-stack _self: (addr code-point-utf8-stack) {
+ 15   var self/esi: (addr code-point-utf8-stack) <- copy _self
  16   var top/eax: (addr int) <- get self, top
  17   copy-to *top, 0
  18 }
  19 
- 20 fn grapheme-stack-empty? _self: (addr grapheme-stack) -> _/eax: boolean {
- 21   var self/esi: (addr grapheme-stack) <- copy _self
+ 20 fn code-point-utf8-stack-empty? _self: (addr code-point-utf8-stack) -> _/eax: boolean {
+ 21   var self/esi: (addr code-point-utf8-stack) <- copy _self
  22   var top/eax: (addr int) <- get self, top
  23   compare *top, 0
  24   {
@@ -91,20 +91,20 @@ if ('onhashchange' in window) {
  28   return 0/false
  29 }
  30 
- 31 fn push-grapheme-stack _self: (addr grapheme-stack), _val: grapheme {
- 32   var self/esi: (addr grapheme-stack) <- copy _self
+ 31 fn push-code-point-utf8-stack _self: (addr code-point-utf8-stack), _val: code-point-utf8 {
+ 32   var self/esi: (addr code-point-utf8-stack) <- copy _self
  33   var top-addr/ecx: (addr int) <- get self, top
- 34   var data-ah/edx: (addr handle array grapheme) <- get self, data
- 35   var data/eax: (addr array grapheme) <- lookup *data-ah
+ 34   var data-ah/edx: (addr handle array code-point-utf8) <- get self, data
+ 35   var data/eax: (addr array code-point-utf8) <- lookup *data-ah
  36   var top/edx: int <- copy *top-addr
- 37   var dest-addr/edx: (addr grapheme) <- index data, top
- 38   var val/eax: grapheme <- copy _val
+ 37   var dest-addr/edx: (addr code-point-utf8) <- index data, top
+ 38   var val/eax: code-point-utf8 <- copy _val
  39   copy-to *dest-addr, val
  40   add-to *top-addr, 1
  41 }
  42 
- 43 fn pop-grapheme-stack _self: (addr grapheme-stack) -> _/eax: grapheme {
- 44   var self/esi: (addr grapheme-stack) <- copy _self
+ 43 fn pop-code-point-utf8-stack _self: (addr code-point-utf8-stack) -> _/eax: code-point-utf8 {
+ 44   var self/esi: (addr code-point-utf8-stack) <- copy _self
  45   var top-addr/ecx: (addr int) <- get self, top
  46   {
  47     compare *top-addr, 0
@@ -112,25 +112,25 @@ if ('onhashchange' in window) {
  49     return -1
  50   }
  51   subtract-from *top-addr, 1
- 52   var data-ah/edx: (addr handle array grapheme) <- get self, data
- 53   var data/eax: (addr array grapheme) <- lookup *data-ah
+ 52   var data-ah/edx: (addr handle array code-point-utf8) <- get self, data
+ 53   var data/eax: (addr array code-point-utf8) <- lookup *data-ah
  54   var top/edx: int <- copy *top-addr
- 55   var result-addr/eax: (addr grapheme) <- index data, top
+ 55   var result-addr/eax: (addr code-point-utf8) <- index data, top
  56   return *result-addr
  57 }
  58 
- 59 fn copy-grapheme-stack _src: (addr grapheme-stack), dest: (addr grapheme-stack) {
- 60   var src/esi: (addr grapheme-stack) <- copy _src
- 61   var data-ah/edi: (addr handle array grapheme) <- get src, data
- 62   var _data/eax: (addr array grapheme) <- lookup *data-ah
- 63   var data/edi: (addr array grapheme) <- copy _data
+ 59 fn copy-code-point-utf8-stack _src: (addr code-point-utf8-stack), dest: (addr code-point-utf8-stack) {
+ 60   var src/esi: (addr code-point-utf8-stack) <- copy _src
+ 61   var data-ah/edi: (addr handle array code-point-utf8) <- get src, data
+ 62   var _data/eax: (addr array code-point-utf8) <- lookup *data-ah
+ 63   var data/edi: (addr array code-point-utf8) <- copy _data
  64   var top-addr/ecx: (addr int) <- get src, top
  65   var i/eax: int <- copy 0
  66   {
  67     compare i, *top-addr
  68     break-if->=
- 69     var g/edx: (addr grapheme) <- index data, i
- 70     push-grapheme-stack dest, *g
+ 69     var g/edx: (addr code-point-utf8) <- index data, i
+ 70     push-code-point-utf8-stack dest, *g
  71     i <- increment
  72     loop
  73   }
@@ -138,18 +138,18 @@ if ('onhashchange' in window) {
  75 
  76 # dump stack to screen from bottom to top
  77 # don't move the cursor or anything
- 78 fn render-stack-from-bottom _self: (addr grapheme-stack), screen: (addr screen) {
- 79   var self/esi: (addr grapheme-stack) <- copy _self
- 80   var data-ah/edi: (addr handle array grapheme) <- get self, data
- 81   var _data/eax: (addr array grapheme) <- lookup *data-ah
- 82   var data/edi: (addr array grapheme) <- copy _data
+ 78 fn render-stack-from-bottom _self: (addr code-point-utf8-stack), screen: (addr screen) {
+ 79   var self/esi: (addr code-point-utf8-stack) <- copy _self
+ 80   var data-ah/edi: (addr handle array code-point-utf8) <- get self, data
+ 81   var _data/eax: (addr array code-point-utf8) <- lookup *data-ah
+ 82   var data/edi: (addr array code-point-utf8) <- copy _data
  83   var top-addr/ecx: (addr int) <- get self, top
  84   var i/eax: int <- copy 0
  85   {
  86     compare i, *top-addr
  87     break-if->=
- 88     var g/edx: (addr grapheme) <- index data, i
- 89     print-grapheme screen, *g
+ 88     var g/edx: (addr code-point-utf8) <- index data, i
+ 89     print-code-point-utf8 screen, *g
  90     i <- increment
  91     loop
  92   }
@@ -157,19 +157,19 @@ if ('onhashchange' in window) {
  94 
  95 # dump stack to screen from top to bottom
  96 # don't move the cursor or anything
- 97 fn render-stack-from-top _self: (addr grapheme-stack), screen: (addr screen) {
- 98   var self/esi: (addr grapheme-stack) <- copy _self
- 99   var data-ah/edi: (addr handle array grapheme) <- get self, data
-100   var _data/eax: (addr array grapheme) <- lookup *data-ah
-101   var data/edi: (addr array grapheme) <- copy _data
+ 97 fn render-stack-from-top _self: (addr code-point-utf8-stack), screen: (addr screen) {
+ 98   var self/esi: (addr code-point-utf8-stack) <- copy _self
+ 99   var data-ah/edi: (addr handle array code-point-utf8) <- get self, data
+100   var _data/eax: (addr array code-point-utf8) <- lookup *data-ah
+101   var data/edi: (addr array code-point-utf8) <- copy _data
 102   var top-addr/ecx: (addr int) <- get self, top
 103   var i/eax: int <- copy *top-addr
 104   i <- decrement
 105   {
 106     compare i, 0
 107     break-if-<
-108     var g/edx: (addr grapheme) <- index data, i
-109     print-grapheme screen, *g
+108     var g/edx: (addr code-point-utf8) <- index data, i
+109     print-code-point-utf8 screen, *g
 110     i <- decrement
 111     loop
 112   }
@@ -177,11 +177,11 @@ if ('onhashchange' in window) {
 114 
 115 # compare from bottom
 116 # beware: modifies 'stream', which must be disposed of after a false result
-117 fn prefix-match? _self: (addr grapheme-stack), s: (addr stream byte) -> _/eax: boolean {
-118   var self/esi: (addr grapheme-stack) <- copy _self
-119   var data-ah/edi: (addr handle array grapheme) <- get self, data
-120   var _data/eax: (addr array grapheme) <- lookup *data-ah
-121   var data/edi: (addr array grapheme) <- copy _data
+117 fn prefix-match? _self: (addr code-point-utf8-stack), s: (addr stream byte) -> _/eax: boolean {
+118   var self/esi: (addr code-point-utf8-stack) <- copy _self
+119   var data-ah/edi: (addr handle array code-point-utf8) <- get self, data
+120   var _data/eax: (addr array code-point-utf8) <- lookup *data-ah
+121   var data/edi: (addr array code-point-utf8) <- copy _data
 122   var top-addr/ecx: (addr int) <- get self, top
 123   var i/ebx: int <- copy 0
 124   {
@@ -189,8 +189,8 @@ if ('onhashchange' in window) {
 126     break-if->=
 127     # if curr != expected, return false
 128     {
-129       var curr-a/edx: (addr grapheme) <- index data, i
-130       var expected/eax: grapheme <- read-grapheme s
+129       var curr-a/edx: (addr code-point-utf8) <- index data, i
+130       var expected/eax: code-point-utf8 <- read-code-point-utf8 s
 131       {
 132         compare expected, *curr-a
 133         break-if-=
@@ -205,11 +205,11 @@ if ('onhashchange' in window) {
 142 
 143 # compare from bottom
 144 # beware: modifies 'stream', which must be disposed of after a false result
-145 fn suffix-match? _self: (addr grapheme-stack), s: (addr stream byte) -> _/eax: boolean {
-146   var self/esi: (addr grapheme-stack) <- copy _self
-147   var data-ah/edi: (addr handle array grapheme) <- get self, data
-148   var _data/eax: (addr array grapheme) <- lookup *data-ah
-149   var data/edi: (addr array grapheme) <- copy _data
+145 fn suffix-match? _self: (addr code-point-utf8-stack), s: (addr stream byte) -> _/eax: boolean {
+146   var self/esi: (addr code-point-utf8-stack) <- copy _self
+147   var data-ah/edi: (addr handle array code-point-utf8) <- get self, data
+148   var _data/eax: (addr array code-point-utf8) <- lookup *data-ah
+149   var data/edi: (addr array code-point-utf8) <- copy _data
 150   var top-addr/eax: (addr int) <- get self, top
 151   var i/ebx: int <- copy *top-addr
 152   i <- decrement
@@ -217,8 +217,8 @@ if ('onhashchange' in window) {
 154     compare i, 0
 155     break-if-<
 156     {
-157       var curr-a/edx: (addr grapheme) <- index data, i
-158       var expected/eax: grapheme <- read-grapheme s
+157       var curr-a/edx: (addr code-point-utf8) <- index data, i
+158       var expected/eax: code-point-utf8 <- read-code-point-utf8 s
 159       # if curr != expected, return false
 160       {
 161         compare expected, *curr-a
@@ -232,18 +232,18 @@ if ('onhashchange' in window) {
 169   return 1   # true
 170 }
 171 
-172 fn grapheme-stack-is-decimal-integer? _self: (addr grapheme-stack) -> _/eax: boolean {
-173   var self/esi: (addr grapheme-stack) <- copy _self
-174   var data-ah/eax: (addr handle array grapheme) <- get self, data
-175   var _data/eax: (addr array grapheme) <- lookup *data-ah
-176   var data/edx: (addr array grapheme) <- copy _data
+172 fn code-point-utf8-stack-is-decimal-integer? _self: (addr code-point-utf8-stack) -> _/eax: boolean {
+173   var self/esi: (addr code-point-utf8-stack) <- copy _self
+174   var data-ah/eax: (addr handle array code-point-utf8) <- get self, data
+175   var _data/eax: (addr array code-point-utf8) <- lookup *data-ah
+176   var data/edx: (addr array code-point-utf8) <- copy _data
 177   var top-addr/ecx: (addr int) <- get self, top
 178   var i/ebx: int <- copy 0
 179   var result/eax: boolean <- copy 1/true
-180   $grapheme-stack-is-integer?:loop: {
+180   $code-point-utf8-stack-is-integer?:loop: {
 181     compare i, *top-addr
 182     break-if->=
-183     var g/edx: (addr grapheme) <- index data, i
+183     var g/edx: (addr code-point-utf8) <- index data, i
 184     result <- decimal-digit? *g
 185     compare result, 0/false
 186     break-if-=
-- 
cgit 1.4.1-2-gfad0