2020-08-29 05:38:08 +00:00
|
|
|
|
# Helpers for Unicode.
|
2020-08-03 03:14:50 +00:00
|
|
|
|
#
|
|
|
|
|
# Mu has no characters, only code points and graphemes.
|
|
|
|
|
# Code points are the indivisible atoms of text streams.
|
2020-08-29 05:38:08 +00:00
|
|
|
|
# https://en.wikipedia.org/wiki/Code_point
|
2020-08-03 03:14:50 +00:00
|
|
|
|
# Graphemes are the smallest self-contained unit of text.
|
|
|
|
|
# Graphemes may consist of multiple code points.
|
|
|
|
|
#
|
|
|
|
|
# Mu graphemes are always represented in utf-8, and they are required to fit
|
|
|
|
|
# in 4 bytes.
|
|
|
|
|
#
|
|
|
|
|
# Mu doesn't currently support combining code points, or graphemes made of
|
2020-08-03 03:51:52 +00:00
|
|
|
|
# multiple code points. One day we will.
|
2020-09-07 04:36:05 +00:00
|
|
|
|
# We also don't currently support code points that translate into multiple
|
|
|
|
|
# or wide graphemes. (In particular, Tab will never be supported.)
|
2020-08-03 03:14:50 +00:00
|
|
|
|
|
|
|
|
|
# transliterated from tb_utf8_unicode_to_char in https://github.com/nsf/termbox
|
|
|
|
|
# https://wiki.tcl-lang.org/page/UTF%2D8+bit+by+bit explains the algorithm
|
2020-08-03 04:25:28 +00:00
|
|
|
|
#
|
|
|
|
|
# The day we want to support combining characters, this function will need to
|
|
|
|
|
# take multiple code points. Or something.
|
2020-11-02 08:07:07 +00:00
|
|
|
|
fn to-grapheme in: code-point -> _/eax: grapheme {
|
2020-08-03 03:14:50 +00:00
|
|
|
|
var c/eax: int <- copy in
|
|
|
|
|
var num-trailers/ecx: int <- copy 0
|
|
|
|
|
var first/edx: int <- copy 0
|
|
|
|
|
$to-grapheme:compute-length: {
|
|
|
|
|
# single byte: just return it
|
|
|
|
|
compare c, 0x7f
|
|
|
|
|
{
|
|
|
|
|
break-if->
|
2020-11-02 08:07:07 +00:00
|
|
|
|
var g/eax: grapheme <- copy c
|
|
|
|
|
return g
|
2020-08-03 03:14:50 +00:00
|
|
|
|
}
|
|
|
|
|
# 2 bytes
|
|
|
|
|
compare c, 0x7ff
|
|
|
|
|
{
|
|
|
|
|
break-if->
|
|
|
|
|
num-trailers <- copy 1
|
|
|
|
|
first <- copy 0xc0
|
|
|
|
|
break $to-grapheme:compute-length
|
|
|
|
|
}
|
|
|
|
|
# 3 bytes
|
|
|
|
|
compare c, 0xffff
|
|
|
|
|
{
|
|
|
|
|
break-if->
|
|
|
|
|
num-trailers <- copy 2
|
|
|
|
|
first <- copy 0xe0
|
|
|
|
|
break $to-grapheme:compute-length
|
|
|
|
|
}
|
|
|
|
|
# 4 bytes
|
|
|
|
|
compare c, 0x1fffff
|
|
|
|
|
{
|
|
|
|
|
break-if->
|
|
|
|
|
num-trailers <- copy 3
|
|
|
|
|
first <- copy 0xf0
|
|
|
|
|
break $to-grapheme:compute-length
|
|
|
|
|
}
|
|
|
|
|
# more than 4 bytes: unsupported
|
2020-08-29 06:24:04 +00:00
|
|
|
|
# TODO: print to stderr
|
2020-08-03 03:14:50 +00:00
|
|
|
|
compare c, 0x1fffff
|
|
|
|
|
{
|
|
|
|
|
break-if->
|
|
|
|
|
print-string-to-real-screen "unsupported code point "
|
|
|
|
|
print-int32-hex-to-real-screen c
|
|
|
|
|
print-string-to-real-screen "\n"
|
|
|
|
|
var exit-status/ebx: int <- copy 1
|
|
|
|
|
syscall_exit
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
# emit trailer bytes, 6 bits from 'in', first two bits '10'
|
2020-11-03 21:29:09 +00:00
|
|
|
|
var result/edi: grapheme <- copy 0
|
2020-08-03 03:14:50 +00:00
|
|
|
|
{
|
|
|
|
|
compare num-trailers, 0
|
|
|
|
|
break-if-<=
|
|
|
|
|
var tmp/esi: int <- copy c
|
|
|
|
|
tmp <- and 0x3f
|
|
|
|
|
tmp <- or 0x80
|
2020-08-03 03:51:52 +00:00
|
|
|
|
result <- shift-left 8
|
2020-08-03 03:14:50 +00:00
|
|
|
|
result <- or tmp
|
|
|
|
|
# update loop state
|
|
|
|
|
c <- shift-right 6
|
|
|
|
|
num-trailers <- decrement
|
|
|
|
|
loop
|
|
|
|
|
}
|
|
|
|
|
# emit engine
|
2020-08-03 03:51:52 +00:00
|
|
|
|
result <- shift-left 8
|
|
|
|
|
result <- or c
|
|
|
|
|
result <- or first
|
2020-08-03 03:14:50 +00:00
|
|
|
|
#
|
2020-11-02 08:07:07 +00:00
|
|
|
|
return result
|
2020-08-03 03:14:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# single-byte code point have identical graphemes
|
|
|
|
|
fn test-to-grapheme-single-byte {
|
|
|
|
|
var in-int/ecx: int <- copy 0
|
|
|
|
|
{
|
|
|
|
|
compare in-int, 0x7f
|
|
|
|
|
break-if->
|
|
|
|
|
var in/eax: code-point <- copy in-int
|
|
|
|
|
var out/eax: grapheme <- to-grapheme in
|
|
|
|
|
var out-int/eax: int <- copy out
|
|
|
|
|
check-ints-equal out-int, in-int, "F - test-to-grapheme-single-byte"
|
|
|
|
|
in-int <- increment
|
|
|
|
|
loop
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-03 03:51:52 +00:00
|
|
|
|
# byte | byte | byte | byte
|
2020-08-03 03:14:50 +00:00
|
|
|
|
# smallest 2-byte utf-8
|
|
|
|
|
fn test-to-grapheme-two-bytes-min {
|
2020-08-03 03:51:52 +00:00
|
|
|
|
var in/eax: code-point <- copy 0x80 # 10 00-0000
|
2020-08-03 03:14:50 +00:00
|
|
|
|
var out/eax: grapheme <- to-grapheme in
|
|
|
|
|
var out-int/eax: int <- copy out
|
2020-08-03 03:51:52 +00:00
|
|
|
|
check-ints-equal out-int, 0x80c2, "F - to-grapheme/2a" # 110 0-0010 10 00-0000
|
2020-08-03 03:14:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# largest 2-byte utf-8
|
|
|
|
|
fn test-to-grapheme-two-bytes-max {
|
2020-08-03 03:51:52 +00:00
|
|
|
|
var in/eax: code-point <- copy 0x7ff # 1-1111 11-1111
|
2020-08-03 03:14:50 +00:00
|
|
|
|
var out/eax: grapheme <- to-grapheme in
|
|
|
|
|
var out-int/eax: int <- copy out
|
2020-08-03 03:51:52 +00:00
|
|
|
|
check-ints-equal out-int, 0xbfdf, "F - to-grapheme/2b" # 110 1-1111 10 11-1111
|
2020-08-03 03:14:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# smallest 3-byte utf-8
|
|
|
|
|
fn test-to-grapheme-three-bytes-min {
|
2020-08-03 03:51:52 +00:00
|
|
|
|
var in/eax: code-point <- copy 0x800 # 10-0000 00-0000
|
2020-08-03 03:14:50 +00:00
|
|
|
|
var out/eax: grapheme <- to-grapheme in
|
|
|
|
|
var out-int/eax: int <- copy out
|
2020-08-03 03:51:52 +00:00
|
|
|
|
check-ints-equal out-int, 0x80a0e0, "F - to-grapheme/3a" # 1110 0000 10 10-0000 10 00-0000
|
2020-08-03 03:14:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-03 03:51:52 +00:00
|
|
|
|
# largest 3-byte utf-8
|
|
|
|
|
fn test-to-grapheme-three-bytes-max {
|
|
|
|
|
var in/eax: code-point <- copy 0xffff # 1111 11-1111 11-1111
|
|
|
|
|
var out/eax: grapheme <- to-grapheme in
|
|
|
|
|
var out-int/eax: int <- copy out
|
|
|
|
|
check-ints-equal out-int, 0xbfbfef, "F - to-grapheme/3b" # 1110 1111 10 11-1111 10 11-1111
|
2020-08-03 03:14:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-03 03:51:52 +00:00
|
|
|
|
# smallest 4-byte utf-8
|
|
|
|
|
fn test-to-grapheme-four-bytes-min {
|
|
|
|
|
var in/eax: code-point <- copy 0x10000 # 1-0000 00-0000 00-0000
|
|
|
|
|
var out/eax: grapheme <- to-grapheme in
|
|
|
|
|
var out-int/eax: int <- copy out
|
|
|
|
|
check-ints-equal out-int, 0x808090f0, "F - to-grapheme/4a" # 1111-0 000 10 01-0000 10 00-0000 10 00-0000
|
2020-08-03 03:14:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-03 03:51:52 +00:00
|
|
|
|
# largest 4-byte utf-8
|
|
|
|
|
fn test-to-grapheme-four-bytes-max {
|
|
|
|
|
var in/eax: code-point <- copy 0x1fffff # 111 11-1111 11-1111 11-1111
|
|
|
|
|
var out/eax: grapheme <- to-grapheme in
|
|
|
|
|
var out-int/eax: int <- copy out
|
|
|
|
|
check-ints-equal out-int, 0xbfbfbff7, "F - to-grapheme/4b" # 1111-0 111 10 11-1111 10 11-1111 10 11-1111
|
2020-08-03 03:14:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-29 06:24:04 +00:00
|
|
|
|
# read the next grapheme from a stream of bytes
|
2020-11-02 08:07:07 +00:00
|
|
|
|
fn read-grapheme in: (addr stream byte) -> _/eax: grapheme {
|
2020-10-27 06:43:58 +00:00
|
|
|
|
# if at eof, return EOF
|
|
|
|
|
{
|
|
|
|
|
var eof?/eax: boolean <- stream-empty? in
|
|
|
|
|
compare eof?, 0 # false
|
|
|
|
|
break-if-=
|
2020-11-02 08:07:07 +00:00
|
|
|
|
return 0xffffffff
|
2020-10-27 06:43:58 +00:00
|
|
|
|
}
|
2020-08-29 06:24:04 +00:00
|
|
|
|
var c/eax: byte <- read-byte in
|
|
|
|
|
var num-trailers/ecx: int <- copy 0
|
|
|
|
|
$read-grapheme:compute-length: {
|
|
|
|
|
# single byte: just return it
|
|
|
|
|
compare c, 0xc0
|
|
|
|
|
{
|
|
|
|
|
break-if->=
|
2020-11-02 08:07:07 +00:00
|
|
|
|
var g/eax: grapheme <- copy c
|
|
|
|
|
return g
|
2020-08-29 06:24:04 +00:00
|
|
|
|
}
|
|
|
|
|
compare c, 0xfe
|
|
|
|
|
{
|
|
|
|
|
break-if-<
|
2020-11-02 08:07:07 +00:00
|
|
|
|
var g/eax: grapheme <- copy c
|
|
|
|
|
return g
|
2020-08-29 06:24:04 +00:00
|
|
|
|
}
|
|
|
|
|
# 2 bytes
|
|
|
|
|
compare c, 0xe0
|
|
|
|
|
{
|
|
|
|
|
break-if->=
|
|
|
|
|
num-trailers <- copy 1
|
|
|
|
|
break $read-grapheme:compute-length
|
|
|
|
|
}
|
|
|
|
|
# 3 bytes
|
|
|
|
|
compare c, 0xf0
|
|
|
|
|
{
|
|
|
|
|
break-if->=
|
|
|
|
|
num-trailers <- copy 2
|
|
|
|
|
break $read-grapheme:compute-length
|
|
|
|
|
}
|
|
|
|
|
# 4 bytes
|
|
|
|
|
compare c, 0xf8
|
|
|
|
|
{
|
|
|
|
|
break-if->=
|
|
|
|
|
num-trailers <- copy 3
|
|
|
|
|
break $read-grapheme:compute-length
|
|
|
|
|
}
|
|
|
|
|
$read-grapheme:abort: {
|
|
|
|
|
# TODO: print to stderr
|
|
|
|
|
print-string-to-real-screen "utf-8 encodings larger than 4 bytes are not supported. First byte seen: "
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
print-int32-hex-to-real-screen n
|
|
|
|
|
print-string-to-real-screen "\n"
|
|
|
|
|
var exit-status/ebx: int <- copy 1
|
|
|
|
|
syscall_exit
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
# prepend trailer bytes
|
2020-11-03 21:29:09 +00:00
|
|
|
|
var result/edi: grapheme <- copy c
|
2020-08-29 06:24:04 +00:00
|
|
|
|
var num-byte-shifts/edx: int <- copy 1
|
|
|
|
|
{
|
|
|
|
|
compare num-trailers, 0
|
|
|
|
|
break-if-<=
|
|
|
|
|
var tmp/eax: byte <- read-byte in
|
|
|
|
|
var tmp2/eax: int <- copy tmp
|
|
|
|
|
tmp2 <- shift-left-bytes tmp2, num-byte-shifts
|
|
|
|
|
result <- or tmp2
|
|
|
|
|
# update loop state
|
|
|
|
|
num-byte-shifts <- increment
|
|
|
|
|
num-trailers <- decrement
|
|
|
|
|
loop
|
|
|
|
|
}
|
2020-11-02 08:07:07 +00:00
|
|
|
|
return result
|
2020-08-29 06:24:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn test-read-grapheme {
|
|
|
|
|
var s: (stream byte 0x30)
|
|
|
|
|
var s2/ecx: (addr stream byte) <- address s
|
|
|
|
|
write s2, "aΒc世d界e"
|
|
|
|
|
var c/eax: grapheme <- read-grapheme s2
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
check-ints-equal n, 0x61, "F - test grapheme/0"
|
|
|
|
|
var c/eax: grapheme <- read-grapheme s2
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
check-ints-equal n, 0x92ce, "F - test grapheme/1" # greek capital letter beta
|
|
|
|
|
var c/eax: grapheme <- read-grapheme s2
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
check-ints-equal n, 0x63, "F - test grapheme/2"
|
|
|
|
|
var c/eax: grapheme <- read-grapheme s2
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
check-ints-equal n, 0x96b8e4, "F - test grapheme/3"
|
|
|
|
|
var c/eax: grapheme <- read-grapheme s2
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
check-ints-equal n, 0x64, "F - test grapheme/4"
|
|
|
|
|
var c/eax: grapheme <- read-grapheme s2
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
check-ints-equal n, 0x8c95e7, "F - test grapheme/5"
|
|
|
|
|
var c/eax: grapheme <- read-grapheme s2
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
check-ints-equal n, 0x65, "F - test grapheme/6"
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-02 08:07:07 +00:00
|
|
|
|
fn read-grapheme-buffered in: (addr buffered-file) -> _/eax: grapheme {
|
2020-09-08 05:09:43 +00:00
|
|
|
|
var c/eax: byte <- read-byte-buffered in
|
|
|
|
|
var num-trailers/ecx: int <- copy 0
|
|
|
|
|
$read-grapheme-buffered:compute-length: {
|
|
|
|
|
# single byte: just return it
|
|
|
|
|
compare c, 0xc0
|
|
|
|
|
{
|
|
|
|
|
break-if->=
|
2020-11-02 08:07:07 +00:00
|
|
|
|
var g/eax: grapheme <- copy c
|
|
|
|
|
return g
|
2020-09-08 05:09:43 +00:00
|
|
|
|
}
|
|
|
|
|
compare c, 0xfe
|
|
|
|
|
{
|
|
|
|
|
break-if-<
|
2020-11-02 08:07:07 +00:00
|
|
|
|
var g/eax: grapheme <- copy c
|
|
|
|
|
return g
|
2020-09-08 05:09:43 +00:00
|
|
|
|
}
|
|
|
|
|
# 2 bytes
|
|
|
|
|
compare c, 0xe0
|
|
|
|
|
{
|
|
|
|
|
break-if->=
|
|
|
|
|
num-trailers <- copy 1
|
|
|
|
|
break $read-grapheme-buffered:compute-length
|
|
|
|
|
}
|
|
|
|
|
# 3 bytes
|
|
|
|
|
compare c, 0xf0
|
|
|
|
|
{
|
|
|
|
|
break-if->=
|
|
|
|
|
num-trailers <- copy 2
|
|
|
|
|
break $read-grapheme-buffered:compute-length
|
|
|
|
|
}
|
|
|
|
|
# 4 bytes
|
|
|
|
|
compare c, 0xf8
|
|
|
|
|
{
|
|
|
|
|
break-if->=
|
|
|
|
|
num-trailers <- copy 3
|
|
|
|
|
break $read-grapheme-buffered:compute-length
|
|
|
|
|
}
|
|
|
|
|
$read-grapheme-buffered:abort: {
|
|
|
|
|
# TODO: print to stderr
|
|
|
|
|
print-string-to-real-screen "utf-8 encodings larger than 4 bytes are not supported. First byte seen: "
|
|
|
|
|
var n/eax: int <- copy c
|
|
|
|
|
print-int32-hex-to-real-screen n
|
|
|
|
|
print-string-to-real-screen "\n"
|
|
|
|
|
var exit-status/ebx: int <- copy 1
|
|
|
|
|
syscall_exit
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
# prepend trailer bytes
|
2020-11-03 21:29:09 +00:00
|
|
|
|
var result/edi: grapheme <- copy c
|
2020-09-08 05:09:43 +00:00
|
|
|
|
var num-byte-shifts/edx: int <- copy 1
|
|
|
|
|
{
|
|
|
|
|
compare num-trailers, 0
|
|
|
|
|
break-if-<=
|
|
|
|
|
var tmp/eax: byte <- read-byte-buffered in
|
|
|
|
|
var tmp2/eax: int <- copy tmp
|
|
|
|
|
tmp2 <- shift-left-bytes tmp2, num-byte-shifts
|
|
|
|
|
result <- or tmp2
|
|
|
|
|
# update loop state
|
|
|
|
|
num-byte-shifts <- increment
|
|
|
|
|
num-trailers <- decrement
|
|
|
|
|
loop
|
|
|
|
|
}
|
2020-11-02 08:07:07 +00:00
|
|
|
|
return result
|
2020-09-08 05:09:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-29 06:24:04 +00:00
|
|
|
|
# needed because available primitives only shift by a literal/constant number of bits
|
2020-11-02 08:07:07 +00:00
|
|
|
|
fn shift-left-bytes n: int, k: int -> _/eax: int {
|
2020-08-29 06:24:04 +00:00
|
|
|
|
var i/ecx: int <- copy 0
|
2020-11-02 08:07:07 +00:00
|
|
|
|
var result/eax: int <- copy n
|
2020-08-29 06:24:04 +00:00
|
|
|
|
{
|
|
|
|
|
compare i, k
|
|
|
|
|
break-if->=
|
|
|
|
|
compare i, 4 # only 4 bytes in 32 bits
|
|
|
|
|
break-if->=
|
|
|
|
|
result <- shift-left 8
|
|
|
|
|
i <- increment
|
|
|
|
|
loop
|
|
|
|
|
}
|
2020-11-02 08:07:07 +00:00
|
|
|
|
return result
|
2020-08-29 06:24:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn test-shift-left-bytes-0 {
|
|
|
|
|
var result/eax: int <- shift-left-bytes 1, 0
|
|
|
|
|
check-ints-equal result, 1, "F - shift-left-bytes 0"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn test-shift-left-bytes-1 {
|
|
|
|
|
var result/eax: int <- shift-left-bytes 1, 1
|
|
|
|
|
check-ints-equal result, 0x100, "F - shift-left-bytes 1"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn test-shift-left-bytes-2 {
|
|
|
|
|
var result/eax: int <- shift-left-bytes 1, 2
|
|
|
|
|
check-ints-equal result, 0x10000, "F - shift-left-bytes 2"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn test-shift-left-bytes-3 {
|
|
|
|
|
var result/eax: int <- shift-left-bytes 1, 3
|
|
|
|
|
check-ints-equal result, 0x1000000, "F - shift-left-bytes 3"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn test-shift-left-bytes-4 {
|
|
|
|
|
var result/eax: int <- shift-left-bytes 1, 4
|
|
|
|
|
check-ints-equal result, 0, "F - shift-left-bytes 4"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn test-shift-left-bytes-5 {
|
|
|
|
|
var result/eax: int <- shift-left-bytes 1, 5
|
|
|
|
|
check-ints-equal result, 0, "F - shift-left-bytes >4"
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-03 03:51:52 +00:00
|
|
|
|
# To run all tests, uncomment this and run:
|
2020-08-29 05:34:07 +00:00
|
|
|
|
# $ ./translate_mu && ./a.elf
|
2020-11-03 22:04:35 +00:00
|
|
|
|
#? fn main -> _/ebx: int {
|
2020-08-03 03:14:50 +00:00
|
|
|
|
#? run-tests
|
2020-08-03 03:51:52 +00:00
|
|
|
|
#? r <- copy 0
|
2020-08-03 03:14:50 +00:00
|
|
|
|
#? }
|
2020-09-20 04:44:48 +00:00
|
|
|
|
|
|
|
|
|
# write a grapheme to a stream of bytes
|
|
|
|
|
# this is like write-to-stream, except we skip leading 0 bytes
|
|
|
|
|
fn write-grapheme out: (addr stream byte), g: grapheme {
|
|
|
|
|
$write-grapheme:body: {
|
|
|
|
|
var c/eax: int <- copy g
|
|
|
|
|
append-byte out, c # first byte is always written
|
|
|
|
|
c <- shift-right 8
|
|
|
|
|
compare c, 0
|
|
|
|
|
break-if-= $write-grapheme:body
|
|
|
|
|
append-byte out, c
|
|
|
|
|
c <- shift-right 8
|
|
|
|
|
compare c, 0
|
|
|
|
|
break-if-= $write-grapheme:body
|
|
|
|
|
append-byte out, c
|
|
|
|
|
c <- shift-right 8
|
|
|
|
|
compare c, 0
|
|
|
|
|
break-if-= $write-grapheme:body
|
|
|
|
|
append-byte out, c
|
|
|
|
|
}
|
|
|
|
|
}
|