From 0452b05f5a78b33d94352c676e021b4a1abfb5f2 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 2 Aug 2020 12:05:25 -0700 Subject: 6703 - new types: code-point and grapheme Both have the same size: 4 bytes. So far I've just renamed print-byte to print-grapheme, but it still behaves the same. I'm going to support printing code-points next, but grapheme 'clusters' spanning multiple code-points won't be supported for some time. --- prototypes/browse/10.mu | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'prototypes/browse/10.mu') diff --git a/prototypes/browse/10.mu b/prototypes/browse/10.mu index 834fec90..5025cb7d 100644 --- a/prototypes/browse/10.mu +++ b/prototypes/browse/10.mu @@ -75,7 +75,8 @@ $line-loop: { compare c, 0xa # newline break-if-= # no need to print newlines # print c - print-byte 0, c + var g/eax: grapheme <- copy c + print-grapheme 0, g col <- increment loop } # $char-loop @@ -171,6 +172,7 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte 0, c + var g/eax: grapheme <- copy c + print-grapheme 0, g loop } -- cgit 1.4.1-2-gfad0