diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-08-02 12:05:25 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-08-02 15:11:52 -0700 |
commit | 0452b05f5a78b33d94352c676e021b4a1abfb5f2 (patch) | |
tree | 53ec02b7898b125b88e27121ee74f22456c524b4 /prototypes/browse/13.mu | |
parent | 1b79f705b9975a3293fd111c5dc129e887dc01c0 (diff) | |
download | mu-0452b05f5a78b33d94352c676e021b4a1abfb5f2.tar.gz |
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.
Diffstat (limited to 'prototypes/browse/13.mu')
-rw-r--r-- | prototypes/browse/13.mu | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/prototypes/browse/13.mu b/prototypes/browse/13.mu index c0371954..0dac8a4d 100644 --- a/prototypes/browse/13.mu +++ b/prototypes/browse/13.mu @@ -99,7 +99,8 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '*' => print c, then normal text - print-byte 0, c + var g/eax: grapheme <- copy c + print-grapheme 0, g col <- increment reset-formatting 0 start-color 0, 0xec, 7 # 236 = darkish gray @@ -110,7 +111,8 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '_' => print c, then normal text - print-byte 0, c + var g/eax: grapheme <- copy c + print-grapheme 0, g col <- increment reset-formatting 0 start-color 0, 0xec, 7 # 236 = darkish gray @@ -123,7 +125,8 @@ $update-attributes:check-state: { 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 +174,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 } |