From d253a3182859c7c989449122a60d5f362f19ded0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 9 Nov 2021 08:12:11 -0800 Subject: rename grapheme to code-point-utf8 Longer name, but it doesn't lie. We have no data structure right now for combining multiple code points. And it makes no sense for the notion of a grapheme to conflate its Unicode encoding. --- browse-slack/environment.mu | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'browse-slack') diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu index 8f53a7f8..e4e24ff6 100644 --- a/browse-slack/environment.mu +++ b/browse-slack/environment.mu @@ -615,12 +615,12 @@ fn draw-json-stream-wrapping-right-then-down screen: (addr screen), stream: (add } compare c, 0xffffffff/end-of-file break-if-= - $draw-json-stream-wrapping-right-then-down:render-grapheme: { + $draw-json-stream-wrapping-right-then-down:render-code-point-utf8: { compare c, 0x5c/backslash { break-if-!= xcurr, ycurr <- render-json-escaped-code-point screen, stream, xmin, ymin, xmax, ymax, xcurr, ycurr, color, background-color - break $draw-json-stream-wrapping-right-then-down:render-grapheme + break $draw-json-stream-wrapping-right-then-down:render-code-point-utf8 } compare c, 0xa/newline { @@ -629,7 +629,7 @@ fn draw-json-stream-wrapping-right-then-down screen: (addr screen), stream: (add var dummy/eax: int <- draw-code-point screen, 0x20/space, xcurr, ycurr, color, background-color xcurr <- copy xmin ycurr <- increment - break $draw-json-stream-wrapping-right-then-down:render-grapheme + break $draw-json-stream-wrapping-right-then-down:render-code-point-utf8 } var offset/eax: int <- draw-code-point screen, c, xcurr, ycurr, color, background-color # overlay a combining character if necessary @@ -639,7 +639,7 @@ fn draw-json-stream-wrapping-right-then-down screen: (addr screen), stream: (add break-if-!= # read a character # no combining character allowed here - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream var c/eax: code-point <- to-code-point g # if not a combining character, save for next iteration and loop { @@ -672,7 +672,7 @@ fn draw-json-stream-wrapping-right-then-down screen: (addr screen), stream: (add # just return a different register fn read-json-code-point stream: (addr stream byte) -> _/ebx: code-point { - var g/eax: grapheme <- read-grapheme stream + var g/eax: code-point-utf8 <- read-code-point-utf8 stream var result/eax: code-point <- to-code-point g return result } @@ -1012,7 +1012,7 @@ fn update-search _env: (addr environment), key: byte, users: (addr array user), # otherwise delegate var search-terms-ah/eax: (addr handle gap-buffer) <- get env, search-terms var search-terms/eax: (addr gap-buffer) <- lookup *search-terms-ah - var g/ecx: grapheme <- copy key + var g/ecx: code-point-utf8 <- copy key edit-gap-buffer search-terms, g } -- cgit 1.4.1-2-gfad0 /a> 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109