Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wa-lang
wa
提交
708fa769
wa
项目概览
wa-lang
/
wa
大约 1 年 前同步成功
通知
68
Star
655
Fork
45
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
wa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
708fa769
编写于
7月 31, 2023
作者:
chai2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
全局用 global 关键字
上级
5024b8a3
变更
38
隐藏空白更改
内联
并排
Showing
38 changed file
with
80 addition
and
113 deletion
+80
-113
waroot/examples/arduino.wa
waroot/examples/arduino.wa
+1
-1
waroot/examples/arduino/app.wa
waroot/examples/arduino/app.wa
+1
-1
waroot/examples/copy.wa
waroot/examples/copy.wa
+1
-1
waroot/examples/llvm/arduino_blink.wa
waroot/examples/llvm/arduino_blink.wa
+1
-1
waroot/examples/llvm/array_1.wa
waroot/examples/llvm/array_1.wa
+2
-2
waroot/examples/llvm/array_2.wa
waroot/examples/llvm/array_2.wa
+1
-1
waroot/examples/llvm/bitwise_logic.wa
waroot/examples/llvm/bitwise_logic.wa
+6
-6
waroot/examples/llvm/global_variable_0.wa
waroot/examples/llvm/global_variable_0.wa
+2
-2
waroot/examples/llvm/global_variable_1.wa
waroot/examples/llvm/global_variable_1.wa
+2
-2
waroot/examples/llvm/pointer.wa
waroot/examples/llvm/pointer.wa
+2
-2
waroot/examples/llvm/shift.wa
waroot/examples/llvm/shift.wa
+6
-6
waroot/examples/llvm/struct_2.wa
waroot/examples/llvm/struct_2.wa
+1
-1
waroot/examples/llvm/struct_3.wa
waroot/examples/llvm/struct_3.wa
+1
-1
waroot/examples/misc/array.wa
waroot/examples/misc/array.wa
+1
-1
waroot/examples/misc/global.wa
waroot/examples/misc/global.wa
+2
-2
waroot/examples/pkg/src/main.wa
waroot/examples/pkg/src/main.wa
+1
-1
waroot/examples/pkg/src/mypkg/mypkg.wa
waroot/examples/pkg/src/mypkg/mypkg.wa
+1
-1
waroot/examples/runtime_print/main.wa
waroot/examples/runtime_print/main.wa
+2
-2
waroot/examples/snake/src/canvas/canvas.wa
waroot/examples/snake/src/canvas/canvas.wa
+1
-1
waroot/examples/snake/src/main.wa
waroot/examples/snake/src/main.wa
+3
-3
waroot/examples/struct.wa
waroot/examples/struct.wa
+1
-1
waroot/examples/surface/surface.wa
waroot/examples/surface/surface.wa
+1
-1
waroot/misc/_example_app/src/main.wa
waroot/misc/_example_app/src/main.wa
+1
-1
waroot/src/binary/binary.wa
waroot/src/binary/binary.wa
+3
-3
waroot/src/bytes/bytes_test.wa
waroot/src/bytes/bytes_test.wa
+2
-2
waroot/src/image/bmp/reader.wa
waroot/src/image/bmp/reader.wa
+1
-1
waroot/src/image/color/palette/palette.wa
waroot/src/image/color/palette/palette.wa
+2
-2
waroot/src/image/geom.wa
waroot/src/image/geom.wa
+2
-2
waroot/src/image/image.wa
waroot/src/image/image.wa
+1
-1
waroot/src/io/io.wa
waroot/src/io/io.wa
+11
-11
waroot/src/math/float_bits.wa
waroot/src/math/float_bits.wa
+4
-4
waroot/src/math/float_bits.wat.ws
waroot/src/math/float_bits.wat.ws
+5
-5
waroot/src/os/os.wa
waroot/src/os/os.wa
+1
-1
waroot/src/regexp/test_example.wa
waroot/src/regexp/test_example.wa
+1
-1
waroot/src/strconv/strconv.wa
waroot/src/strconv/strconv.wa
+0
-33
waroot/src/syscall/arduino/arduino.wa
waroot/src/syscall/arduino/arduino.wa
+1
-1
waroot/src/unicode/graphic.wa
waroot/src/unicode/graphic.wa
+2
-2
waroot/src/unicode/utf8/utf8.wa
waroot/src/unicode/utf8/utf8.wa
+3
-3
未找到文件。
waroot/examples/arduino.wa
浏览文件 @
708fa769
...
...
@@ -2,7 +2,7 @@
import "syscall/arduino"
var
LED = arduino.GetPinLED()
global
LED = arduino.GetPinLED()
func init {
arduino.PinMode(LED, arduino.OUTPUT)
...
...
waroot/examples/arduino/app.wa
浏览文件 @
708fa769
...
...
@@ -2,7 +2,7 @@
import "syscall/arduino"
var
LED = arduino.GetPinLED()
global
LED = arduino.GetPinLED()
func init {
arduino.PinMode(LED, 1)
...
...
waroot/examples/copy.wa
浏览文件 @
708fa769
// 版权 @2021 凹语言 作者。保留所有权利。
var
s = []int{1, 2, 3, 4, 5, 6}
global
s = []int{1, 2, 3, 4, 5, 6}
func main() {
d := make([]int, 3)
...
...
waroot/examples/llvm/arduino_blink.wa
浏览文件 @
708fa769
...
...
@@ -6,7 +6,7 @@
func write_port(p: i16, v: i8)
// Delay a period of time
var
cnt: i8
global
cnt: i8
func delay(n: i32) {
for i := i32(0); i < n; i++ {
...
...
waroot/examples/llvm/array_1.wa
浏览文件 @
708fa769
...
...
@@ -5,8 +5,8 @@ const size = 32
type fff32 f32
var
arr0: [size]fff32
var
arr1: [size]fff32
global
arr0: [size]fff32
global
arr1: [size]fff32
func test_init() {
for i := 0; i < size; i++ {
...
...
waroot/examples/llvm/array_2.wa
浏览文件 @
708fa769
...
...
@@ -5,7 +5,7 @@ const size = 32
type fff32 f32
var
arr1: [size]fff32
global
arr1: [size]fff32
func makearr0a(i: int) => [size]fff32 {
r: [size]fff32
...
...
waroot/examples/llvm/bitwise_logic.wa
浏览文件 @
708fa769
// Test the llvm backend.
// Test bitwise logic.
var
a: i64 = 0x55555555
var
b: i64 = 0x33333333
var
c: i16 = 0x5555
var
d: i16 = 0x3333
var
e: u8 = 0x55
var
f: u8 = 0x33
global
a: i64 = 0x55555555
global
b: i64 = 0x33333333
global
c: i16 = 0x5555
global
d: i16 = 0x3333
global
e: u8 = 0x55
global
f: u8 = 0x33
func main() {
println("not ", 0x55555555, " = ", bw_not(0x55555555))
...
...
waroot/examples/llvm/global_variable_0.wa
浏览文件 @
708fa769
...
...
@@ -6,8 +6,8 @@ type ty0 struct {
v1: f64
}
var
gv0: ty0 = ty0{5555, 3.1415926}
var
gv1: [4]int = [4]int{81, 82, 17, 76}
global
gv0: ty0 = ty0{5555, 3.1415926}
global
gv1: [4]int = [4]int{81, 82, 17, 76}
func test_global_variable() {
println("gv0: {", gv0.v0, ", ", gv0.v1, "}")
...
...
waroot/examples/llvm/global_variable_1.wa
浏览文件 @
708fa769
...
...
@@ -6,8 +6,8 @@ type ty0 struct {
v1: f64
}
var
gv0: ty0 = ty0{5555, 3.1415926}
var
gv1: [4]int = [4]int{81, 82, 17, 76}
global
gv0: ty0 = ty0{5555, 3.1415926}
global
gv1: [4]int = [4]int{81, 82, 17, 76}
func test_global_variable() {
gv0.v0 = 8888
...
...
waroot/examples/llvm/pointer.wa
浏览文件 @
708fa769
// Test the llvm backend.
// Test read/write via a pointer.
var
gint0: int = 100
var
gint1: int = 200
global
gint0: int = 100
global
gint1: int = 200
func get_int_addr(a: int) => *int {
if a > 0 {
...
...
waroot/examples/llvm/shift.wa
浏览文件 @
708fa769
// Test the llvm backend.
// Test logical/arithmetic shift operations.
var
ga: i32 = -15
var
gb: i32 = 15
var
gc: i64 = -15
var
gd: i64 = 15
var
ge: u16 = 0xffcc
global
ga: i32 = -15
global
gb: i32 = 15
global
gc: i64 = -15
global
gd: i64 = 15
global
ge: u16 = 0xffcc
func main
()
{
func main {
println(ga, " << ", 2, " = ", test_shl_0(ga, 2))
println(gb, " << ", 2, " = ", test_shl_1(gb, 2))
println(ga, " << ", 2, " = ", test_shl_2(ga, 2))
...
...
waroot/examples/llvm/struct_2.wa
浏览文件 @
708fa769
...
...
@@ -10,7 +10,7 @@ type struct_t0 struct {
arr1: [size]fff32
}
var
st0: struct_t0
global
st0: struct_t0
func test_init() {
for i := 0; i < size; i++ {
...
...
waroot/examples/llvm/struct_3.wa
浏览文件 @
708fa769
...
...
@@ -8,7 +8,7 @@ type struct_t0 struct {
arr1: [size]f32
}
var
st1: struct_t0
global
st1: struct_t0
func maket0a(i: int) => struct_t0 {
r: struct_t0
...
...
waroot/examples/misc/array.wa
浏览文件 @
708fa769
// 版权 @2021 凹语言 作者。保留所有权利。
var
I: [8]i32
global
I: [8]i32
func Gen_arr(param: [8]i32) => [8]i32 {
param[3] += 2
...
...
waroot/examples/misc/global.wa
浏览文件 @
708fa769
// 版权 @2021 凹语言 作者。保留所有权利。
var
counter: i32 = 13
var
G: *i32
global
counter: i32 = 13
global
G: *i32
func gen_i() => *i32 {
i: i32
...
...
waroot/examples/pkg/src/main.wa
浏览文件 @
708fa769
...
...
@@ -9,7 +9,7 @@ type ST struct {
B: i32
}
var
G: ST
global
G: ST
func Do {
G.A = "13"
...
...
waroot/examples/pkg/src/mypkg/mypkg.wa
浏览文件 @
708fa769
...
...
@@ -5,7 +5,7 @@ type ST struct {
B: string
}
var
G: ST
global
G: ST
func Do(x: i32) {
G.A = x
...
...
waroot/examples/runtime_print/main.wa
浏览文件 @
708fa769
...
...
@@ -37,7 +37,7 @@ const (
)
func main {
runtime_printBytes([]byte{
'a', 'b', '\n'})
runtime_printBytes([]byte{'a', 'b', '\n'})
runtime_printString("hello\n")
runtime_printString("== printBool ==\n")
...
...
@@ -65,7 +65,7 @@ func main {
runtime_printNewline()
runtime_printU64(MaxUint64)
runtime_printNewline()
runtime_printU64(MaxUint64
/
2)
runtime_printU64(MaxUint64
/
2)
runtime_printNewline()
runtime_printString("== printHex ==\n")
...
...
waroot/examples/snake/src/canvas/canvas.wa
浏览文件 @
708fa769
...
...
@@ -85,7 +85,7 @@ func Canvas.Flush() {
updateCanvas_JS(this.device_id, &this.frame_buf[0])
}
var
canvas_events: []CanvasEvents
global
canvas_events: []CanvasEvents
func AttachCanvasEvents(e: CanvasEvents) {
for i := range canvas_events {
...
...
waroot/examples/snake/src/main.wa
浏览文件 @
708fa769
...
...
@@ -2,7 +2,7 @@
import "snake/canvas"
var
ca: *canvas.Canvas
global
ca: *canvas.Canvas
type Position struct {
x, y: i32
...
...
@@ -26,7 +26,7 @@ const (
DirDown
)
var
Dirs: [5]Position
global
Dirs: [5]Position
type GameState struct {
w, h: i32
...
...
@@ -38,7 +38,7 @@ type GameState struct {
ca: *canvas.Canvas
}
var
gameState: GameState
global
gameState: GameState
func GameState.Init(w, h: i32, scale: i32) {
this.w = w
...
...
waroot/examples/struct.wa
浏览文件 @
708fa769
// 版权 @2023 凹语言 作者。保留所有权利。
var
Info: struct {
global
Info: struct {
name: string
age: i32
}
...
...
waroot/examples/surface/surface.wa
浏览文件 @
708fa769
...
...
@@ -11,7 +11,7 @@ const (
angle = math.Pi / 6 // angle of x, y axes (=30°)
)
var
sin30, cos30 = math.Sin(angle), math.Cos(angle) // sin(30°), cos(30°)
global
sin30, cos30 = math.Sin(angle), math.Cos(angle) // sin(30°), cos(30°)
func main {
print("<svg xmlns='http://www.w3.org/2000/svg' style='stroke: grey; fill: white; stroke-width: 0.7' ")
...
...
waroot/misc/_example_app/src/main.wa
浏览文件 @
708fa769
...
...
@@ -7,7 +7,7 @@ func main {
}
func sum(n: int) => int {
v
ar v
: int
v: int
for i := 1; i <= n; i++ {
v += i
}
...
...
waroot/src/binary/binary.wa
浏览文件 @
708fa769
...
...
@@ -37,10 +37,10 @@ type ByteOrder interface {
}
// LittleEndian is the little-endian implementation of ByteOrder.
var
LittleEndian = &littleEndian{}
global
LittleEndian = &littleEndian{}
// BigEndian is the big-endian implementation of ByteOrder.
var
BigEndian = &bigEndian{}
global
BigEndian = &bigEndian{}
type littleEndian struct{}
...
...
@@ -392,7 +392,7 @@ func Size(v interface{}) int {
return dataSize(reflect.Indirect(reflect.ValueOf(v)))
}
var
structSize sync.Map // map[reflect.Type]int
global
structSize sync.Map // map[reflect.Type]int
// dataSize returns the number of bytes the actual data represented by v occupies in memory.
// For compound structures, it sums the sizes of the elements. Thus, for instance, for a slice
...
...
waroot/src/bytes/bytes_test.wa
浏览文件 @
708fa769
...
...
@@ -23,7 +23,7 @@ func TestEqualFold {
}
}
var
EqualFoldTests = []struct {
global
EqualFoldTests = []struct {
s, t string
out bool
}{
...
...
@@ -35,7 +35,7 @@ var EqualFoldTests = []struct {
{"abcdefghijk", "abcdefghijX", false},
}
var
compareTests = []struct {
global
compareTests = []struct {
a, b []byte
i int
}{
...
...
waroot/src/image/bmp/reader.wa
浏览文件 @
708fa769
...
...
@@ -9,7 +9,7 @@ import (
// ErrUnsupported means that the input BMP image uses a valid but unsupported
// feature.
var
ErrUnsupported = errors.New("bmp: unsupported BMP image")
global
ErrUnsupported = errors.New("bmp: unsupported BMP image")
func readUint16(b: []byte) => uint16 {
return uint16(b[0]) | uint16(b[1])<<8
...
...
waroot/src/image/color/palette/palette.wa
浏览文件 @
708fa769
...
...
@@ -16,7 +16,7 @@ import "image/color"
//
// This palette was used in the Plan 9 Operating System, described at
// https://9p.io/magic/man2html/6/color
var
Plan9 = []color.Color{
global
Plan9 = []color.Color{
&color.RGBA{0x00, 0x00, 0x00, 0xff},
&color.RGBA{0x00, 0x00, 0x44, 0xff},
&color.RGBA{0x00, 0x00, 0x88, 0xff},
...
...
@@ -279,7 +279,7 @@ var Plan9 = []color.Color{
// of Netscape Navigator. It is also known as the Netscape Color Cube.
//
// See https://en.wikipedia.org/wiki/Web_colors#Web-safe_colors for details.
var
WebSafe = []color.Color{
global
WebSafe = []color.Color{
&color.RGBA{0x00, 0x00, 0x00, 0xff},
&color.RGBA{0x00, 0x00, 0x33, 0xff},
&color.RGBA{0x00, 0x00, 0x66, 0xff},
...
...
waroot/src/image/geom.wa
浏览文件 @
708fa769
...
...
@@ -65,7 +65,7 @@ func (p: Point) Eq(q: Point) => bool {
// ZP is the zero Point.
//
// Deprecated: Use a literal image.Point{} instead.
var
ZP: Point
global
ZP: Point
// Pt is shorthand for Point{X, Y}.
func Pt(X, Y: int) => Point {
...
...
@@ -264,7 +264,7 @@ func (r: Rectangle) ColorModel => color.Model {
// ZR is the zero Rectangle.
//
// Deprecated: Use a literal image.Rectangle{} instead.
var
ZR: Rectangle
global
ZR: Rectangle
// Rect is shorthand for Rectangle{Pt(x0, y0), Pt(x1, y1)}. The returned
// rectangle has minimum and maximum coordinates swapped if necessary so that
...
...
waroot/src/image/image.wa
浏览文件 @
708fa769
...
...
@@ -1230,7 +1230,7 @@ func (p *Paletted) SubImage(r Rectangle) Image {
// Opaque scans the entire image and reports whether it is fully opaque.
func (p *Paletted) Opaque() bool {
var present
[256]bool
present:
[256]bool
i0, i1 := 0, p.Rect.Dx()
for y := p.Rect.Min.Y; y < p.Rect.Max.Y; y++ {
for _, c := range p.Pix[i0:i1] {
...
...
waroot/src/io/io.wa
浏览文件 @
708fa769
...
...
@@ -11,13 +11,13 @@ const (
// ErrShortWrite means that a write accepted fewer bytes than requested
// but failed to return an explicit error.
var
ErrShortWrite = errors.New("short write")
global
ErrShortWrite = errors.New("short write")
// errInvalidWrite means that a write returned an impossible count.
var
errInvalidWrite = errors.New("invalid write result")
global
errInvalidWrite = errors.New("invalid write result")
// ErrShortBuffer means that a read required a longer buffer than was provided.
var
ErrShortBuffer = errors.New("short buffer")
global
ErrShortBuffer = errors.New("short buffer")
// EOF is the error returned by Read when no more input is available.
// (Read must return EOF itself, not an error wrapping EOF,
...
...
@@ -26,16 +26,16 @@ var ErrShortBuffer = errors.New("short buffer")
// If the EOF occurs unexpectedly in a structured data stream,
// the appropriate error is either ErrUnexpectedEOF or some other error
// giving more detail.
var
EOF = errors.New("EOF")
global
EOF = errors.New("EOF")
// ErrUnexpectedEOF means that EOF was encountered in the
// middle of reading a fixed-size block or data structure.
var
ErrUnexpectedEOF = errors.New("unexpected EOF")
global
ErrUnexpectedEOF = errors.New("unexpected EOF")
// ErrNoProgress is returned by some clients of an Reader when
// many calls to Read have failed to return any data or error,
// usually the sign of a broken Reader implementation.
var
ErrNoProgress = errors.New("multiple Read calls return no data or error")
global
ErrNoProgress = errors.New("multiple Read calls return no data or error")
// Reader is the interface that wraps the basic Read method.
//
...
...
@@ -309,7 +309,7 @@ func ReadAtLeast(r: Reader, buf: []byte, min: int) => (n: int, err: error) {
return 0, ErrShortBuffer
}
for n < min && err == nil {
var
nn :int
global
nn :int
nn, err = r.Read(buf[n:])
n += nn
}
...
...
@@ -487,8 +487,8 @@ func SectionReader.Read(p: []byte) => (n: int, err: error) {
return
}
var
errWhence = errors.New("Seek: invalid whence")
var
errOffset = errors.New("Seek: invalid offset")
global
errWhence = errors.New("Seek: invalid whence")
global
errOffset = errors.New("Seek: invalid offset")
func SectionReader.Seek(offset: i64, whence: int) => (i64, error) {
switch whence {
...
...
@@ -553,13 +553,13 @@ func teeReader.Read(p: []byte) => (n: int, err: error) {
// Discard is a Writer on which all Write calls succeed
// without doing anything.
var
Discard :Writer = &discard{}
global
Discard :Writer = &discard{}
type discard struct{}
// discard implements ReaderFrom as an optimization so Copy to
// io.Discard can avoid doing unnecessary work.
var
_ :ReaderFrom = &discard{}
global
_ :ReaderFrom = &discard{}
func discard.Write(p: []byte) => (int, error) {
return len(p), nil
...
...
waroot/src/math/float_bits.wa
浏览文件 @
708fa769
// 版权 @2023 凹语言 作者。保留所有权利。
#wa:linkname $waFloat64bits
#wa:linkname $
math.
waFloat64bits
func waFloat64bits(x: f64) => u64
#wa:linkname $waFloat64frombits
#wa:linkname $
math.
waFloat64frombits
func waFloat64frombits(x: u64) => f64
#wa:linkname $waFloat32bits
#wa:linkname $
math.
waFloat32bits
func waFloat32bits(x: f32) => u32
#wa:linkname $waFloat32frombits
#wa:linkname $
math.
waFloat32frombits
func waFloat32frombits(x: u32) => f32
// Float64bits returns the IEEE 754 binary representation of f,
...
...
waroot/src/math/float_bits.wat.ws
浏览文件 @
708fa769
;; Copyright 2023 The Wa Authors. All rights reserved.
(func $$waFloat64bits (param $x f64) (result i64)
(func $$
math.
waFloat64bits (param $x f64) (result i64)
local.get $x
i64.reinterpret_f64
)
(func $$waFloat64frombits (param $x i64) (result f64)
(func $$
math.
waFloat64frombits (param $x i64) (result f64)
local.get $x
f64.reinterpret_i64
)
(func $$waFloat32bits (param $x f32) (result i32)
(func $$
math.
waFloat32bits (param $x f32) (result i32)
local.get $x
i32.reinterpret_f32
)
(func $$waFloat32frombits (param $x i32) (result f32)
(func $$
math.
waFloat32frombits (param $x i32) (result f32)
local.get $x
f32.reinterpret_i32
)
\ No newline at end of file
)
waroot/src/os/os.wa
浏览文件 @
708fa769
// 版权 @2023 凹语言 作者。保留所有权利。
var
Args: []string
global
Args: []string
#wa:linkname runtime.os_get_args
func os_get_args() => []string
...
...
waroot/src/regexp/test_example.wa
浏览文件 @
708fa769
...
...
@@ -6,7 +6,7 @@ func TestMatch {
}
}
var
tests = []struct {
global
tests = []struct {
name :string
regexp :string
text :string
...
...
waroot/src/strconv/strconv.wa
浏览文件 @
708fa769
// 版权 @2023 凹语言 作者。保留所有权利。
// 十进制整数 x 转为字符串
func __Itoa(x: int) => string {
return __itoa(x)
}
func __itoa(num: int) => string {
if num == 0 {
return "0"
}
var isNegative = false
var str: string
// 用于 byte 到 string 转型
var digit2StrTable = []string{
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
}
if num < 0 {
isNegative = true
num = -num
}
for ; num != 0; num = num / 10 {
str = digit2StrTable[num%10] + str
}
if isNegative {
return "-" + str
}
return str
}
waroot/src/syscall/arduino/arduino.wa
浏览文件 @
708fa769
// 版权 @2022 凹语言 作者。保留所有权利。
var
(
const
(
LOW :i32 = 0
HIGH :i32 = 1
...
...
waroot/src/unicode/graphic.wa
浏览文件 @
708fa769
...
...
@@ -16,13 +16,13 @@ const (
)
// GraphicRanges defines the set of graphic characters according to Unicode.
var
GraphicRanges = []*RangeTable{
global
GraphicRanges = []*RangeTable{
L, M, N, P, S, Zs,
}
// PrintRanges defines the set of printable characters according to Go.
// ASCII space, U+0020, is handled separately.
var
PrintRanges = []*RangeTable{
global
PrintRanges = []*RangeTable{
L, M, N, P, S,
}
...
...
waroot/src/unicode/utf8/utf8.wa
浏览文件 @
708fa769
...
...
@@ -59,7 +59,7 @@ const (
)
// first is information about the first byte in a UTF-8 sequence.
var
first = [256]u8{
global
first = [256]u8{
// 1 2 3 4 5 6 7 8 9 A B C D E F
as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x00-0x0F
as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x10-0x1F
...
...
@@ -90,7 +90,7 @@ type acceptRange struct {
}
// acceptRanges has size 16 to avoid bounds checks in the code that uses it.
var
acceptRanges = [16]acceptRange{
global
acceptRanges = [16]acceptRange{
0: {locb, hicb},
1: {0xA0, hicb},
2: {locb, 0x9F},
...
...
@@ -385,7 +385,7 @@ func EncodeRune(p: []byte, r: rune) => int {
// encodings are treated as single runes of width 1 byte.
func RuneCount(p: []byte) => int {
np := len(p)
var
n :int
n :int
for i := 0; i < np; {
n++
c := p[i]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录