提交 53f9d895 编写于 作者: 3 3dgen

修正 runtime 的 utf8 相关常量定义位置错误

上级 33f6724e
......@@ -204,6 +204,22 @@ func next_rune(iter: stringIter) => (ok: bool, k: int, v: rune, pos: int) {
return
}
const (
MaxRune = '\U0010FFFF'
RuneError = '\uFFFD'
surrogateMin = 0xD800
surrogateMax = 0xDFFF
tx = 0b10000000
t2 = 0b11000000
t3 = 0b11100000
t4 = 0b11110000
maskx = 0b00111111
rune1Max = 1<<7 - 1
rune2Max = 1<<11 - 1
rune3Max = 1<<16 - 1
)
func stringFromRune(r: rune) => string {
p := make([]byte, 0, 4)
n: i32
......
......@@ -114,22 +114,6 @@ func waPrintString(s: string) {
printString(s)
}
const (
MaxRune = '\U0010FFFF'
RuneError = '\uFFFD'
surrogateMin = 0xD800
surrogateMax = 0xDFFF
tx = 0b10000000
t2 = 0b11000000
t3 = 0b11100000
t4 = 0b11110000
maskx = 0b00111111
rune1Max = 1<<7 - 1
rune2Max = 1<<11 - 1
rune3Max = 1<<16 - 1
)
#wa:linkname $runtime.waPrintRune
func waPrintRune(r: i32) {
printString(stringFromRune(r))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册