diff options
author | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-08-17 10:36:15 +0800 |
commit | e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch) | |
tree | 6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec | |
parent | 289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff) | |
download | yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.gz yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.tar.bz2 yuescript-e61cce21ef7def2c2e52dd6cb6a5b540ebcac29d.zip |
add unicode identifier support, fix more issue from #144
Diffstat (limited to 'spec')
85 files changed, 13119 insertions, 11 deletions
diff --git a/spec/inputs/unicode/ambiguous.yue b/spec/inputs/unicode/ambiguous.yue new file mode 100644 index 0000000..9f42223 --- /dev/null +++ b/spec/inputs/unicode/ambiguous.yue | |||
@@ -0,0 +1,82 @@ | |||
1 | import 绑定 from 抓取 | ||
2 | (绑定 声明) 颜色: "Red" | ||
3 | |||
4 | 变量a = 'b' | ||
5 | 变量c = 变量d | ||
6 | (变量a 变量b) 变量c 变量d | ||
7 | import 变量c from 变量d | ||
8 | (变量a 变量b) 变量c 变量d | ||
9 | (变量c 变量d) 变量a 变量b | ||
10 | 变量a, 变量b = 变量c, 变量d | ||
11 | (变量d 变量a) 变量c | ||
12 | |||
13 | macro 宏 = (函数, 参数)-> "(#{函数}) #{参数}" | ||
14 | for 计数 = 1, 10 | ||
15 | 变量a = -> | ||
16 | $宏 打印, 1 | ||
17 | 变量a = 变量f | ||
18 | $宏 打印, 2 | ||
19 | if 条件 | ||
20 | $宏 打印, 3 | ||
21 | ::跳转位置:: | ||
22 | (打印) 4 | ||
23 | goto 跳转位置 | ||
24 | (打印) 5 | ||
25 | |||
26 | macro 🌛 = (代码)-> { | ||
27 | code: 代码 | ||
28 | type: "lua" | ||
29 | } | ||
30 | |||
31 | do | ||
32 | 打印() | ||
33 | 1 |> b变量 |> (a变量) | ||
34 | 打印() | ||
35 | <- (fn) | ||
36 | |||
37 | do | ||
38 | 打印() | ||
39 | () <- 异步函数() | ||
40 | 打印() | ||
41 | $🌛[==[ | ||
42 | --[[a comment to insert]] | ||
43 | (haha)() | ||
44 | ]==] | ||
45 | nil | ||
46 | |||
47 | macro 宏v = -> '打印 123' | ||
48 | do | ||
49 | global * | ||
50 | $宏v! | ||
51 | |||
52 | do | ||
53 | 函数f | ||
54 | :v变量 | ||
55 | |||
56 | 数组 = while 条件f | ||
57 | :v变量 | ||
58 | |||
59 | repeat | ||
60 | 打印 变量v | ||
61 | until 条件f | ||
62 | :变量v | ||
63 | |||
64 | with 条件f | ||
65 | :变量v = 数组 | ||
66 | .字段x = 1 | ||
67 | |||
68 | 变量x = if 条件f | ||
69 | :字段v | ||
70 | |||
71 | 变量x = switch 条件f | ||
72 | :字段v | ||
73 | when 条件f | ||
74 | :字段v | ||
75 | |||
76 | 数字数组 = for 数字 = 1, 长度 | ||
77 | :数字 | ||
78 | |||
79 | 对象数组 = for 物件 in *物件数组 | ||
80 | 名称: 物件 | ||
81 | |||
82 | nil | ||
diff --git a/spec/inputs/unicode/assign.yue b/spec/inputs/unicode/assign.yue new file mode 100644 index 0000000..5392a92 --- /dev/null +++ b/spec/inputs/unicode/assign.yue | |||
@@ -0,0 +1,92 @@ | |||
1 | |||
2 | _无效变量 = -> | ||
3 | joop变量 = 2302 | ||
4 | |||
5 | (好) -> | ||
6 | 变量d = 100 | ||
7 | 好 = 1021 | ||
8 | |||
9 | 变量a,变量b,变量c,变量d = 1,2,3,4 | ||
10 | |||
11 | 你好[232], (5+5)[121], 你好, 变量x[99] = 100, 200, 300, 400 | ||
12 | |||
13 | joop变量 = 12 | ||
14 | |||
15 | joop变量 = 2345 | ||
16 | |||
17 | 变量a, 变量b = if 你好 | ||
18 | "你好", nil | ||
19 | else | ||
20 | "没啥", "✌️" | ||
21 | |||
22 | |||
23 | 变量a, 变量b = if 你好 | ||
24 | if ✌️ then "一", "二" else "mmhh", nil | ||
25 | else | ||
26 | 打印 "其它东西" | ||
27 | "没啥事", "✌️" | ||
28 | |||
29 | 变量c, 变量d = 1, 2 if true | ||
30 | |||
31 | 变量x = (do | ||
32 | 函数! | ||
33 | 123) if 函数 = 获取处理函数! | ||
34 | |||
35 | (using nil) <- _无效变量 | ||
36 | |||
37 | a变量.<> = do | ||
38 | 打印 123 | ||
39 | {} | ||
40 | |||
41 | do | ||
42 | {元素a, 元素b} = switch 对象c | ||
43 | when "a" | ||
44 | 字典 | ||
45 | when "b" | ||
46 | 函数! | ||
47 | |||
48 | a数组[] = if 条件x | ||
49 | 1 | ||
50 | else | ||
51 | 2 | ||
52 | |||
53 | do | ||
54 | 变量a, 变量b[] = if x条件 | ||
55 | switch 对象y | ||
56 | when 1 | ||
57 | 函数! | ||
58 | |||
59 | do | ||
60 | 变量a, {元素b} = if x条件 | ||
61 | 函数! | ||
62 | else | ||
63 | 123, 表 | ||
64 | |||
65 | do | ||
66 | 变量a, 数组b[], 对象c, 对象d.<add> = if 条件x | ||
67 | switch 对象y | ||
68 | when 1 | ||
69 | 函数! | ||
70 | elseif 条件x2 | ||
71 | if 条件y2 | ||
72 | 函数1! | ||
73 | else | ||
74 | 打印 "hello" | ||
75 | do | ||
76 | 打印 123 | ||
77 | 1, 函数2! | ||
78 | |||
79 | do | ||
80 | 变量a = 变量b = 变量c = 变量d = 0 | ||
81 | |||
82 | do | ||
83 | a变量 = b变量 = c变量 = d变量 = 函数! | ||
84 | |||
85 | do | ||
86 | {a元素} = :字段b = 对象c.字段d = 变量e = 数组对象 | ||
87 | |||
88 | do | ||
89 | 值 = 123 | ||
90 | 变量a = 变量b = 变量c = 值 | ||
91 | |||
92 | nil | ||
diff --git a/spec/inputs/unicode/attrib.yue b/spec/inputs/unicode/attrib.yue new file mode 100644 index 0000000..def1d2a --- /dev/null +++ b/spec/inputs/unicode/attrib.yue | |||
@@ -0,0 +1,53 @@ | |||
1 | const 常量a, 常量b, 常量c, 常量d = 1, 2, 3, 4 | ||
2 | |||
3 | do | ||
4 | close 关闭变量a, 关闭变量b = setmetatable {},__close:=> 打印 "已关闭" | ||
5 | const 变量c, 常量d = 123, 'abc' | ||
6 | |||
7 | close 常量a, 常量b | ||
8 | const 常量c, 常量d | ||
9 | |||
10 | do | ||
11 | const 常量a, {元素b, 元素c}, {元素d} = 函数!, 函数1! | ||
12 | |||
13 | do | ||
14 | const 常量a, {元素b, 元素c}, {元素d} = 函数! | ||
15 | |||
16 | do | ||
17 | close 关闭变量v = if 标记为真 | ||
18 | 函数调用! | ||
19 | else | ||
20 | <close>: => | ||
21 | |||
22 | close 关闭变量f = with io.open "文件.txt" | ||
23 | \write "你好" | ||
24 | |||
25 | do | ||
26 | const 常量a = 1 if true | ||
27 | close 关闭变量b = (if 条件x then 1) unless false | ||
28 | const 常量c = (switch 条件x | ||
29 | when "abc" then 998) if true | ||
30 | close 关闭变量d = | ||
31 | :数值 if 条件a ?? 条件b | ||
32 | |||
33 | do | ||
34 | close _无效变量 = with io.open "文件.txt" | ||
35 | \write "你好" | ||
36 | |||
37 | close _无效变量 = <close>: -> 打印 "第二" | ||
38 | |||
39 | close _无效变量 = <close>: -> 打印 "第一" | ||
40 | |||
41 | _延迟对象数组 = <close>: => | ||
42 | @[#@]! | ||
43 | @[#@] = nil | ||
44 | |||
45 | 延迟 = (项目)-> | ||
46 | _延迟对象数组[] = 项目 | ||
47 | _延迟对象数组 | ||
48 | |||
49 | do | ||
50 | close _无效变量 = 延迟 -> 打印 3 | ||
51 | close _无效变量 = 延迟 -> 打印 2 | ||
52 | close _无效变量 = 延迟 -> 打印 1 | ||
53 | |||
diff --git a/spec/inputs/unicode/backcall.yue b/spec/inputs/unicode/backcall.yue new file mode 100644 index 0000000..9589f70 --- /dev/null +++ b/spec/inputs/unicode/backcall.yue | |||
@@ -0,0 +1,79 @@ | |||
1 | do | ||
2 | (项目) <- 映射 {1,2,3} | ||
3 | 项目 * 2 | ||
4 | |||
5 | do | ||
6 | (项目) <- 映射 _,{1,2,3} | ||
7 | 项目 * 2 | ||
8 | |||
9 | do | ||
10 | (项目) <- 过滤 _, do | ||
11 | (项目) <- 映射 _,{1,2,3,4} | ||
12 | 项目 * 2 | ||
13 | 项目 > 2 | ||
14 | |||
15 | do | ||
16 | (数据) <- 网络?.获取 "测试地址" | ||
17 | 网页体[".结果"]\网页 数据 | ||
18 | (是否处理成功) <- 网络.请求 "测试地址", 数据 | ||
19 | 网页体[".结果"]\添加 是否处理成果 | ||
20 | <- 设置超时回调 1000 | ||
21 | 打印 "完成" | ||
22 | |||
23 | do | ||
24 | <- 同步状态 | ||
25 | (错误信息, 数据="nil") <- 异步加载 "文件.yue" | ||
26 | if 错误信息 | ||
27 | 打印 错误信息 | ||
28 | return | ||
29 | (代码) <- 异步编译 数据 | ||
30 | 结果函数 = 加载字符串 代码 | ||
31 | 结果函数! | ||
32 | |||
33 | do | ||
34 | <- 函数1 | ||
35 | <- 函数2 | ||
36 | do | ||
37 | <- 函数3 | ||
38 | <- 函数4 | ||
39 | <- 函数5 | ||
40 | <- 函数6 | ||
41 | 函数7! | ||
42 | |||
43 | do | ||
44 | :结果,:消息 = do | ||
45 | (数据) <- 异步接收 "文件名.txt" | ||
46 | 打印 数据 | ||
47 | (信息) <- 异步处理 数据 | ||
48 | 检查 信息 | ||
49 | 打印 结果, 消息 | ||
50 | |||
51 | 总大小 = (for 文件 in *文件数组 | ||
52 | (数据) <- 异步加载 文件 | ||
53 | 加入缓存 文件, 数据) |> 合并 0, (对象a, 对象b)-> 对象a + 对象b | ||
54 | |||
55 | 属性A = do | ||
56 | (值) <= 属性定义 => @_值 | ||
57 | 打印 "之前值: #{@_值}" | ||
58 | 打印 "最新值: #{值}" | ||
59 | @_值 = 值 | ||
60 | |||
61 | 属性B = do | ||
62 | <= 属性定义 _, (值)=> | ||
63 | 打印 "之前值: #{@_值}" | ||
64 | 打印 "最新值: #{值}" | ||
65 | @_值 = 值 | ||
66 | @_值 | ||
67 | |||
68 | 警告 "嗨" | ||
69 | |||
70 | local 变量x, 变量y, 变量z | ||
71 | 变量x = do (变量a) < -变量b | ||
72 | 变量x, 变量y, 变量z = do (变量a) <- 变量b | ||
73 | 变量x, 变量y, 变量z = do (变量a) <-变量b | ||
74 | |||
75 | 变量x = do 变量a <= 变量b | ||
76 | 变量x, 变量y, 变量z = do (变量a) <= 变量b | ||
77 | |||
78 | nil | ||
79 | |||
diff --git a/spec/inputs/unicode/bubbling.yue b/spec/inputs/unicode/bubbling.yue new file mode 100644 index 0000000..824263a --- /dev/null +++ b/spec/inputs/unicode/bubbling.yue | |||
@@ -0,0 +1,27 @@ | |||
1 | |||
2 | -- vararg bubbling | ||
3 | 函数 = (...) -> #{...} | ||
4 | |||
5 | 不要冒泡 = -> | ||
6 | [元素 for 元素 in ((...)-> 打印 ...)("你好")] | ||
7 | |||
8 | 变量k = [元素 for 元素 in ((...)-> 打印 ...)("你好")] | ||
9 | |||
10 | 变量j = for 计数 = 1, 10 | ||
11 | (...) -> 打印 ... | ||
12 | |||
13 | -- bubble me | ||
14 | |||
15 | 变量m = (...) -> | ||
16 | [元素 for 元素 in *{...} when 函数(...) > 4] | ||
17 | |||
18 | _无效变量 = (...)-> | ||
19 | 数组x = for 计数 in *{...} do 计数 | ||
20 | 数组y = [元素 for 元素 in *{...}] | ||
21 | 数组z = [元素 for 元素 in 列表 when 函数(...) > 4] | ||
22 | |||
23 | 数组a = for 计数 = 1, 10 do ... | ||
24 | |||
25 | 数组b = for 计数 = 1, 10 | ||
26 | (...)-> 打印 ... | ||
27 | |||
diff --git a/spec/inputs/unicode/class.yue b/spec/inputs/unicode/class.yue new file mode 100644 index 0000000..70bbb07 --- /dev/null +++ b/spec/inputs/unicode/class.yue | |||
@@ -0,0 +1,245 @@ | |||
1 | |||
2 | class 你好 | ||
3 | new: (@测试, @世界) => | ||
4 | 打印 "创建对象.." | ||
5 | 你好: => | ||
6 | 打印 @测试, @世界 | ||
7 | __tostring: => "你好 世界" | ||
8 | |||
9 | 对象x = 你好 1,2 | ||
10 | 对象x\你好() | ||
11 | |||
12 | 打印 对象x | ||
13 | |||
14 | class 简单 | ||
15 | 酷: => 打印 "酷" | ||
16 | |||
17 | class 伊克斯 extends 简单 | ||
18 | new: => 打印 "你好已创建" | ||
19 | |||
20 | x对象 = 伊克斯() | ||
21 | x对象\酷() | ||
22 | |||
23 | |||
24 | class 嗨 | ||
25 | new: (参数) => | ||
26 | 打印 "初始化参数", 参数 | ||
27 | |||
28 | 酷: (数值) => | ||
29 | 打印 "数值", 数值 | ||
30 | |||
31 | |||
32 | class 简单 extends 嗨 | ||
33 | new: => super "伙计" | ||
34 | 酷: => super 120302 | ||
35 | |||
36 | x对象 = 简单() | ||
37 | x对象\酷() | ||
38 | |||
39 | 打印 x对象.__class == 简单 | ||
40 | |||
41 | |||
42 | class 好吧 | ||
43 | -- what is going on | ||
44 | 一些东西: 20323 | ||
45 | -- yeaha | ||
46 | |||
47 | |||
48 | class 好哒 extends 好吧 | ||
49 | 一些东西: => | ||
50 | super 1,2,3,4 | ||
51 | super.一些东西 另一个自己, 1,2,3,4 | ||
52 | 断言 super == 好吧 | ||
53 | |||
54 | |||
55 | class 好 | ||
56 | 不错: => | ||
57 | super\一些东西 1,2,3,4 | ||
58 | |||
59 | |||
60 | class 什么 | ||
61 | 一些东西: => 打印 "值:", @值 | ||
62 | |||
63 | class 你好 extends 什么 | ||
64 | 值: 2323 | ||
65 | 一些东西: => super\一些东西 | ||
66 | |||
67 | with 你好! | ||
68 | 对象x = \一些对象! | ||
69 | 打印 对象x | ||
70 | 对象x! | ||
71 | |||
72 | class 超级酷 | ||
73 | 👋: => | ||
74 | super(1,2,3,4) 1,2,3,4 | ||
75 | super.一些东西 1,2,3,4 | ||
76 | _ = super.一些东西(1,2,3,4).世界 | ||
77 | super\好吧"世界".不错 哈, 哈, 哈 | ||
78 | _ = 一些东西.上级 | ||
79 | _ = super.上级.上级.上级 | ||
80 | _ = super\你好 | ||
81 | nil | ||
82 | |||
83 | |||
84 | -- selfing | ||
85 | 变量x = @你好 | ||
86 | 变量x = @@你好 | ||
87 | |||
88 | @你好 "世界" | ||
89 | @@你好 "世界" | ||
90 | |||
91 | @@一 @@二(4,5) @三, @四 | ||
92 | |||
93 | 变量xx = (@你好, @@世界, 酷) -> | ||
94 | |||
95 | |||
96 | -- class properties | ||
97 | class 一个类 | ||
98 | @好: 343 | ||
99 | 蓝色: => | ||
100 | @你好: 3434, @世界: 23423 | ||
101 | 绿色: => | ||
102 | @红色: => | ||
103 | |||
104 | |||
105 | 变量x = @ | ||
106 | 变量y = @@ | ||
107 | |||
108 | @ 一些东西 | ||
109 | |||
110 | @@ 一些东西 | ||
111 | |||
112 | @ = @ + @ / @ | ||
113 | |||
114 | @ = 343 | ||
115 | @.你好 2,3,4 | ||
116 | |||
117 | _ = 你好[@].世界 | ||
118 | |||
119 | |||
120 | class 怪怪的 | ||
121 | _ = @你好 | ||
122 | if 一些东西 | ||
123 | 打印 "你好世界" | ||
124 | |||
125 | 你好 = "世界" | ||
126 | @另一 = "天" | ||
127 | |||
128 | 打印 "好" if 一些东西 -- this is briken | ||
129 | |||
130 | |||
131 | 打印 "你好" | ||
132 | |||
133 | 变量yyy = -> | ||
134 | class 酷 | ||
135 | _ = nil | ||
136 | |||
137 | |||
138 | -- | ||
139 | |||
140 | class 对象a.字段b.字段c.子类D | ||
141 | _ = nil | ||
142 | |||
143 | |||
144 | class 对象a.字段b["你好"] | ||
145 | _ = nil | ||
146 | |||
147 | class (-> require "moon")!.某个成员 extends 你好.世界 | ||
148 | _ = nil | ||
149 | |||
150 | -- | ||
151 | |||
152 | 类a = class | ||
153 | 类b = class 一个类 | ||
154 | 类c = class 一个类 extends 你好 | ||
155 | 类d = class extends 世界 | ||
156 | |||
157 | 打印 (class 啥事).__name | ||
158 | |||
159 | -- | ||
160 | |||
161 | global ^ | ||
162 | class 一个类 | ||
163 | _ = nil | ||
164 | |||
165 | |||
166 | -- | ||
167 | |||
168 | -- hoisting | ||
169 | class 一个类 | ||
170 | 值 = 23 | ||
171 | {:插入} = 表 | ||
172 | new: => 打印 插入, 值 -- prints nil 23 | ||
173 | |||
174 | -- | ||
175 | |||
176 | class X类 | ||
177 | new: 嗨 | ||
178 | |||
179 | |||
180 | -- | ||
181 | |||
182 | class 酷 extends 东西 | ||
183 | 当: => | ||
184 | { | ||
185 | 你好: -> super! | ||
186 | 世界: -> super.one | ||
187 | } | ||
188 | |||
189 | -- | ||
190 | |||
191 | class 奇怪 extends 东西 | ||
192 | 当: 做点事 => | ||
193 | super! | ||
194 | |||
195 | --- | ||
196 | |||
197 | class 喔哈 extends 东西 | ||
198 | @底部: -> | ||
199 | super! | ||
200 | _ = super.你好 | ||
201 | super\你好! | ||
202 | super\你好 | ||
203 | |||
204 | |||
205 | @空间: 酷 { | ||
206 | -> | ||
207 | super! | ||
208 | _ = super.你好 | ||
209 | super\你好! | ||
210 | super\你好 | ||
211 | } | ||
212 | |||
213 | do | ||
214 | class 测试 | ||
215 | new: => @@如果 = true | ||
216 | @做: => 1 | ||
217 | 测试: => @@如果 and @@做! | ||
218 | 测试实例 = 测试! | ||
219 | 测试实例\测试! | ||
220 | |||
221 | do | ||
222 | class 测试 | ||
223 | new: => @如果 = true | ||
224 | 做: => 1 | ||
225 | 测试: => @如果 and @做! | ||
226 | 测试实例 = 测试! | ||
227 | 测试实例\测试! | ||
228 | |||
229 | class extends 青.应用 | ||
230 | "/": => json: { 状态: true } | ||
231 | |||
232 | class 类A using 类B, 类C, 类D, {值: 123} | ||
233 | |||
234 | class 示例 | ||
235 | @字段1 = 1 | ||
236 | @字段2 = @字段1 + 1 | ||
237 | |||
238 | class 随便 | ||
239 | new: (参数) => @x字段 = 参数 | ||
240 | <mul>: (参数y) => @x字段 * 参数y | ||
241 | <"任意名称">: 123 | ||
242 | :相加 | ||
243 | :<add> | ||
244 | |||
245 | nil | ||
diff --git a/spec/inputs/unicode/comprehension.yue b/spec/inputs/unicode/comprehension.yue new file mode 100644 index 0000000..52debf2 --- /dev/null +++ b/spec/inputs/unicode/comprehension.yue | |||
@@ -0,0 +1,52 @@ | |||
1 | |||
2 | -- see lists.moon for list comprehension tests | ||
3 | |||
4 | 列表 = {1,2,3,4,5,6} | ||
5 | 输出 = {元素, 元素 * 2 for 元素 in 对象数组} | ||
6 | |||
7 | |||
8 | 字典x = 你好: "世界", 好吧: 2323 | ||
9 | |||
10 | 复制 = {键, 值 for 键, 值 in pairs 对象x when 键 != "好吧"} | ||
11 | |||
12 | -- | ||
13 | |||
14 | _无效变量 = { 解包(元素) for 元素 in 是的 } | ||
15 | _无效变量 = { 解包(元素) for 元素 in *是的 } | ||
16 | |||
17 | _无效变量 = { 元素元素 for 元素 in 是的 } | ||
18 | _无效变量 = { 解包 [对象 * 计数 for 计数, 对象 in ipairs x对象] for x对象 in *{{1,2}, {3,4}} } | ||
19 | |||
20 | |||
21 | -- | ||
22 | |||
23 | 变量1 = [计数 for 计数 = 1, 10] | ||
24 | 变量2 = [计数 for 计数 = 1, 10 when 计数 % 2 == 1] | ||
25 | |||
26 | 变量aa = [{计数x,计数y} for 计数x=1,10 for 计数y=5,14] | ||
27 | 变量bb = [对象y for 元素 in 对象y for 计数i=1,10] | ||
28 | 变量cc = [对象y for 计数=1,10 for 元素 in 对象y] | ||
29 | 变量dd = [对象y for 计数=1,10 when 酷 for 元素 in 对象y when 变量x > 3 when 变量c + 3] | ||
30 | |||
31 | _无效变量 = {"你好", "世界" for 计数=1,10} | ||
32 | |||
33 | -- | ||
34 | |||
35 | 变量j = [元素a for {元素a,元素b,元素c} in 很多东西] | ||
36 | 变量k = [元素a for {元素a,元素b,元素c} in *很多东西] | ||
37 | 变量i = [你好 for {:你好, :世界} in *很多东西] | ||
38 | |||
39 | 变量hj = {元素a,元素c for {元素a,元素b,元素c} in 很多东西} | ||
40 | 变量hk = {元素a,元素c for {元素a,元素b,元素c} in *很多东西} | ||
41 | 变量hi = {你好,世界 for {:你好,:世界} in *很多东西} | ||
42 | |||
43 | 没错(元素a,元素b,元素c) for {元素a,元素b,元素c} in 很多东西 | ||
44 | |||
45 | -- | ||
46 | |||
47 | _无效变量 = [项目 for 项目 in *列表[1 + 2,3+4]] | ||
48 | _无效变量 = [项目 for 项目 in *列表[你好! * 4, 2 - 东西[4]]] | ||
49 | |||
50 | 列表 = [项目?\调用 123 for 项目 in 列表] | ||
51 | |||
52 | nil | ||
diff --git a/spec/inputs/unicode/cond.yue b/spec/inputs/unicode/cond.yue new file mode 100644 index 0000000..362408c --- /dev/null +++ b/spec/inputs/unicode/cond.yue | |||
@@ -0,0 +1,232 @@ | |||
1 | |||
2 | 你很酷 = false | ||
3 | |||
4 | _无效变量 = if 酷 | ||
5 | if 你很酷 | ||
6 | 一 | ||
7 | else if 吃东西 | ||
8 | 好 | ||
9 | else | ||
10 | _无效变量 = 二 | ||
11 | 三 | ||
12 | else | ||
13 | 否 | ||
14 | |||
15 | _无效变量 = if 酷 then 否 | ||
16 | _无效变量 = if 酷 then 否 else 是 | ||
17 | |||
18 | if 酷 then 喔 酷 else | ||
19 | 没那么 酷 | ||
20 | |||
21 | if 在工作 | ||
22 | _无效变量 = if 酷 then if 酷 then 好吧 else 什么 else 呐 | ||
23 | |||
24 | |||
25 | if ✌️ then 无 日 elseif 酷 我 then 好吧 呀 else u型 路 | ||
26 | if ✌️ then 无 父 else if 酷 你 then 好吧 吧 else p型 路 | ||
27 | |||
28 | |||
29 | if (->)() then 随便 怎样 | ||
30 | |||
31 | if nil then 翻转 我 else | ||
32 | 这个 是, 弧度 | ||
33 | |||
34 | |||
35 | if 东西 不错 then 没 法 elseif 好的 确定 | ||
36 | 什么 这里 | ||
37 | |||
38 | |||
39 | if 很多东西 then 没 机会 | ||
40 | elseif 好吧 | ||
41 | 现在 怎么办 | ||
42 | |||
43 | |||
44 | if 很多东西 | ||
45 | 是 伙计 | ||
46 | elseif 好的 人 then 嗨 好呀 else 嗯 确定 | ||
47 | |||
48 | if 我们 走吧 | ||
49 | 打印 "打招呼" | ||
50 | elseif "只有我们" | ||
51 | 打印 "威尔史密斯" else 显示 5555555 | ||
52 | |||
53 | -- | ||
54 | |||
55 | if 某东西 = 10 | ||
56 | 打印 某东西 | ||
57 | else | ||
58 | 打印 "其它" | ||
59 | |||
60 | 你好 = if 某东西 = 10 | ||
61 | 打印 某东西 | ||
62 | else | ||
63 | 打印 "其它" | ||
64 | |||
65 | |||
66 | 你好 = 5 + if 某东西 = 10 | ||
67 | 打印 某东西 | ||
68 | |||
69 | --- | ||
70 | |||
71 | z变量 = false | ||
72 | |||
73 | _无效变量 = if false | ||
74 | 一 | ||
75 | elseif 条件x = true | ||
76 | 二 | ||
77 | elseif 条件z = true | ||
78 | 三 | ||
79 | else | ||
80 | 四 | ||
81 | |||
82 | |||
83 | 输出 = if false | ||
84 | 一 | ||
85 | elseif 条件x = true | ||
86 | 二 | ||
87 | elseif 条件z = true | ||
88 | 三 | ||
89 | else | ||
90 | 四 | ||
91 | |||
92 | 变量 = -> | ||
93 | if 某东西 = true | ||
94 | 1 | ||
95 | elseif 另一个 = false | ||
96 | 2 | ||
97 | |||
98 | --- | ||
99 | |||
100 | unless true | ||
101 | 打印 "酷!" | ||
102 | |||
103 | unless true and false | ||
104 | 打印 "酷!" | ||
105 | |||
106 | unless false then 打印 "酷!" | ||
107 | unless false then 打印 "酷!" else 打印 "no way!" | ||
108 | |||
109 | unless nil | ||
110 | 打印 "hello" | ||
111 | else | ||
112 | 打印 "world" | ||
113 | |||
114 | -- | ||
115 | |||
116 | x = unless true | ||
117 | 打印 "酷!" | ||
118 | |||
119 | x = unless true and false | ||
120 | 打印 "酷!" | ||
121 | |||
122 | y = unless false then 打印 "酷!" | ||
123 | y = unless false then 打印 "酷!" else 打印 "没门!" | ||
124 | |||
125 | z = unless nil | ||
126 | 打印 "你好" | ||
127 | else | ||
128 | 打印 "世界" | ||
129 | |||
130 | 打印 unless true | ||
131 | 打印 "酷!" | ||
132 | |||
133 | 打印 unless true and false | ||
134 | 打印 "酷!" | ||
135 | |||
136 | 打印 unless false then 打印 "酷!" | ||
137 | 打印 unless false then 打印 "酷!" else 打印 "没门!" | ||
138 | |||
139 | 打印 unless nil | ||
140 | 打印 "你好" | ||
141 | else | ||
142 | 打印 "世界" | ||
143 | |||
144 | -- | ||
145 | |||
146 | 打印 "你好" unless 值 | ||
147 | |||
148 | 变量dddd = {1,2,3} unless 值 | ||
149 | |||
150 | |||
151 | -- | ||
152 | |||
153 | do | ||
154 | j变量 = 100 | ||
155 | unless j变量 = 嗨! | ||
156 | 错误 "不是 j变量!" | ||
157 | |||
158 | ---------------- | ||
159 | |||
160 | 变量a = 12 | ||
161 | 变量a,变量c,变量b = "酷", nil, nil if 某东西 | ||
162 | |||
163 | |||
164 | |||
165 | --- | ||
166 | |||
167 | 变量j = if 1 | ||
168 | if 2 | ||
169 | 3 | ||
170 | else 6 | ||
171 | |||
172 | |||
173 | 变量m = if 1 | ||
174 | |||
175 | |||
176 | |||
177 | if 2 | ||
178 | |||
179 | |||
180 | 3 | ||
181 | |||
182 | |||
183 | else 6 | ||
184 | |||
185 | do | ||
186 | 函数a | ||
187 | :字段b | ||
188 | return if 函数a | ||
189 | :字段b | ||
190 | else if 函数c | ||
191 | 字段d: 变量e | ||
192 | else | ||
193 | 字段f: 123 | ||
194 | |||
195 | do | ||
196 | 函数c | ||
197 | 字段d: 变量e | ||
198 | if 条件a | ||
199 | :字段b = 变量tb | ||
200 | elseif 条件c | ||
201 | 字段d: 变量e = 变量tb | ||
202 | |||
203 | if :派 = 数学库 | ||
204 | 打印 派 | ||
205 | |||
206 | do | ||
207 | local 数学库 | ||
208 | if :派 = 数学库 | ||
209 | 打印 派 | ||
210 | |||
211 | do | ||
212 | if _模块 = {} | ||
213 | :东西 = _模块 | ||
214 | :a功能, :b功能 = _模块 | ||
215 | |||
216 | do | ||
217 | global _模块 | ||
218 | if _模块 = {} | ||
219 | :东西 = _模块 | ||
220 | :a功能, :b功能 = _模块 | ||
221 | |||
222 | do | ||
223 | 变量v = if 1 and do | ||
224 | 0 ~= 1 | ||
225 | 1 | ||
226 | else | ||
227 | 2 | ||
228 | |||
229 | nil | ||
230 | |||
231 | |||
232 | |||
diff --git a/spec/inputs/unicode/destructure.yue b/spec/inputs/unicode/destructure.yue new file mode 100644 index 0000000..5efdf82 --- /dev/null +++ b/spec/inputs/unicode/destructure.yue | |||
@@ -0,0 +1,228 @@ | |||
1 | |||
2 | do | ||
3 | {元素a, 元素b} = 你好 | ||
4 | |||
5 | {{元素a}, 元素b, {元素c}} = 你好 | ||
6 | |||
7 | { :你好, :世界 } = 值 | ||
8 | |||
9 | do | ||
10 | { 是: 否, 东西 } = 世界 | ||
11 | |||
12 | {:字段a,:字段b,:字段c,:d字段} = 好 | ||
13 | |||
14 | {a元素}, 变量b = 一, 二 | ||
15 | {b元素}, 变量c = 一, nil | ||
16 | {d元素}, 变量e = 一, 二 | ||
17 | |||
18 | 变量x, {元素y} = 一, 二 | ||
19 | |||
20 | 变量xx, 变量yy = 1, 2 | ||
21 | {元素yy, 元素xx} = {变量xx, 变量yy} | ||
22 | |||
23 | {元素a, :字段b, 元素c, :字段d, 元素e, :字段f, 元素g} = 表 | ||
24 | |||
25 | do :字段a, :字段b, 变量c = 表, nil | ||
26 | |||
27 | do 变量a, :字段b, :字段c = 表, _无效变量 | ||
28 | |||
29 | do :字段a, 变量b, :字段c = 表, _无效变量, _无效变量 | ||
30 | |||
31 | --- | ||
32 | |||
33 | do | ||
34 | 未来人们 = | ||
35 | 雕刻家: "翁贝托·博乔尼" | ||
36 | 画家: "弗拉基米尔·伯留克" | ||
37 | 诗人: | ||
38 | 姓名: "F.T.马里内蒂" | ||
39 | 地址: { | ||
40 | "罗马42R大街" | ||
41 | "贝拉焦,意大利 22021" | ||
42 | } | ||
43 | |||
44 | do {诗人: {:姓名, 地址: {街道, 城市}}} = 未来人们 | ||
45 | |||
46 | do { | ||
47 | :雕刻家 | ||
48 | :画家 | ||
49 | 诗人: | ||
50 | :姓名 | ||
51 | 地址: | ||
52 | * 街道 | ||
53 | * 城市 | ||
54 | } = 未来人们 | ||
55 | |||
56 | do | ||
57 | 字段a: | ||
58 | 字段b: 变量c | ||
59 | 字段d: 变量e = 对象tb | ||
60 | |||
61 | do | ||
62 | 字段a: | ||
63 | * 字段b: 变量c | ||
64 | * 字段d: 变量e | ||
65 | * 元素f = 对象tb | ||
66 | |||
67 | -- | ||
68 | |||
69 | do | ||
70 | { @世界 } = 变量x | ||
71 | { 对象a.字段b, 对象c.字段y, 函数!.字段z } = 变量x | ||
72 | |||
73 | { 世界: @世界 } = 变量x | ||
74 | |||
75 | -- | ||
76 | |||
77 | do | ||
78 | 东西 = {{1,2}, {3,4}} | ||
79 | |||
80 | for {元素x,元素y} in *东西 | ||
81 | 打印 元素x,元素y | ||
82 | |||
83 | |||
84 | -- | ||
85 | |||
86 | do | ||
87 | with {元素a,元素b} = 东西 | ||
88 | 打印 元素a, 元素b | ||
89 | |||
90 | |||
91 | -- | ||
92 | |||
93 | do | ||
94 | 东西 = nil | ||
95 | if {元素a} = 东西 | ||
96 | 打印 元素a | ||
97 | else | ||
98 | 打印 "没东西" | ||
99 | |||
100 | 东东 = {1,2} | ||
101 | if {元素a,元素b} = 东东 | ||
102 | 打印 元素a,元素b | ||
103 | |||
104 | if {元素a,元素b} = 东西 | ||
105 | 打印 元素a,元素b | ||
106 | elseif {元素c,元素d} = 东东 | ||
107 | 打印 元素c,元素d | ||
108 | else | ||
109 | 打印 "不" | ||
110 | |||
111 | -- | ||
112 | |||
113 | do | ||
114 | 变量z = "好" | ||
115 | {元素a,元素b,元素c} = 变量z | ||
116 | |||
117 | do | ||
118 | {元素a,元素b,元素c} = 变量z | ||
119 | |||
120 | _ = (参数z) -> | ||
121 | {元素a,元素b,元素c} = 参数z | ||
122 | |||
123 | do | ||
124 | 变量z = "〇〇" | ||
125 | _ = (参数k) -> | ||
126 | {元素a,元素b,元素c} = 参数z | ||
127 | |||
128 | do | ||
129 | {函数:{结束:结束变量}} = 东西 | ||
130 | |||
131 | do | ||
132 | {如果:{元素a,元素b,元素c}} = 东西 | ||
133 | |||
134 | do | ||
135 | {:字段a, :字段b} = {字段a: "你好", 字段b: "世界"} if true | ||
136 | |||
137 | {天, 小时, 分钟, 秒} = [tonumber 元素 for 元素 in *{ | ||
138 | string.match "1 2 3 4", "(.+)%s(.+)%s(.+)%s(.+)" | ||
139 | }] | ||
140 | |||
141 | {:一, :二, :三} = {匹配结果, true for 匹配结果 in 随机对象\全局匹配("%S+")} | ||
142 | |||
143 | {:字段a},变量b = 对象a\如果(123) + 变量t, 123 | ||
144 | |||
145 | do | ||
146 | {:名称 = "没名字", :工作 = "没工作"} = 个人 | ||
147 | |||
148 | 请求 = (地址, 选项 = {}) -> | ||
149 | { | ||
150 | :方式 = "GET" | ||
151 | :请求头 = {} | ||
152 | :参数 = {} | ||
153 | :负载 = "" | ||
154 | :确认 | ||
155 | :错误 | ||
156 | :最终处理 | ||
157 | } = 选项 | ||
158 | 结果 = 发起请求(地址, 方式, 参数, 负载, 确认, 错误, 最终处理) | ||
159 | return 结果 | ||
160 | |||
161 | {键1: {键2: 值1 = 123}, :键3 = "abc"} = 对象tb | ||
162 | |||
163 | {<>: 元表 = {__index: {字段abc: 123}}, <>: {:<call> = (-> {}), :<add>}} = 对象tb | ||
164 | |||
165 | {字段x: {<>: 元表x = {}}, :y字段, z字段: z变量, :<index> = -> nil} = 对象tb | ||
166 | |||
167 | {<>: {函数: a对象.b字段(-> 123).字段c = 项目?.默认值}} = 对象tb | ||
168 | |||
169 | do | ||
170 | {<>: 元表 = {}, <sub>: 减函数} = 对象tb.字段x | ||
171 | |||
172 | do | ||
173 | {x字段: {<>: 元表 = {}, <sub>: 减函数}} = 对象tb | ||
174 | |||
175 | do | ||
176 | {元素a = 1, 元素b = 2, 字段c: {对像d.字段e = 3}} = 对象tb | ||
177 | |||
178 | for {左 = "null", 右 = false} in *元组列表 | ||
179 | 打印 左, 右 | ||
180 | |||
181 | do | ||
182 | {_, a元素, _, b元素} = 对象tb -- list placeholder | ||
183 | |||
184 | do | ||
185 | {字段x: 对象a.字段b = 1, y字段: a对象.c字段 = 2} = 对象x.字段x.字段x | ||
186 | |||
187 | do | ||
188 | const :宽, :高 = 视区.尺寸 | ||
189 | const {:x坐标 = 0.0, :y坐标 = 0.0} = 点 | ||
190 | |||
191 | do | ||
192 | 变量1, 变量2, 变量3, 数组a[], 变量d, {元素b}, 变量e, 对象c.<> = 1, 2, 3, 函数! | ||
193 | 变量y1, :字段y2, :字段y3, 变量y4 = 函数1!, 函数2! | ||
194 | |||
195 | do | ||
196 | { | ||
197 | [["abc"]]: 变量v1 = 111, | ||
198 | [1 + 1]: {变量v2 = 222, 变量v3 = 333}, | ||
199 | @x: 变量v4 = 444 | ||
200 | }, \ | ||
201 | 'x-y-z': 变量v5, [函数!]: {[函数2!]: 变量v6, 变量v7} = 对象tb, 对象tb2 | ||
202 | |||
203 | do | ||
204 | <[名称]>: 元值, [名称]: 值 = 对象tb | ||
205 | |||
206 | do | ||
207 | {:<tostring> = (-> "名称"), :<add>} = 对象tb | ||
208 | |||
209 | switch 对象tb | ||
210 | when {:<name> = "项目", <"123">: 元字段} | ||
211 | 打印 name, 元字段 | ||
212 | |||
213 | do | ||
214 | 对象tb = {} | ||
215 | <[变量a + 变量b]>: 变量v1, [函数c!]: 变量v2 = 对象tb | ||
216 | |||
217 | do | ||
218 | {a: {:<add> = 加函数}, b: {<[字段名]>: 字段 = 123}} = 对象tb | ||
219 | {<"字段abc">: 元字段 = "默认值", <[[任意 字符串]]>: 变量abc = 123, <'字符串'>: 有默认值 = {}} = 对象tb | ||
220 | |||
221 | switch 对象tb | ||
222 | when {字段a: {:<add> = 加函数}, b: {<[字段名]>: 字段 = 123}} | ||
223 | 打印 add, 字段 | ||
224 | switch tb | ||
225 | when {字段c: {<"字段abc">: 元字段 = "默认值"}, <[[any string]]>: {字段d: 变量abc = 123}, <'字符串'>: {字段e: 有默认值 = {}}} | ||
226 | 打印 元字段, 变量abc, 有默认值 | ||
227 | nil | ||
228 | |||
diff --git a/spec/inputs/unicode/do.yue b/spec/inputs/unicode/do.yue new file mode 100644 index 0000000..5b452bf --- /dev/null +++ b/spec/inputs/unicode/do.yue | |||
@@ -0,0 +1,27 @@ | |||
1 | |||
2 | do | ||
3 | 打印 "你好" | ||
4 | 打印 "世界" | ||
5 | |||
6 | 变量x = do | ||
7 | 打印 "你好" | ||
8 | 打印 "世界" | ||
9 | |||
10 | 变量y = do | ||
11 | 东西 = "shhh" | ||
12 | -> "你好: " .. 东西 | ||
13 | |||
14 | _ = -> if 某条件 then do "好的" | ||
15 | |||
16 | 变量t = { | ||
17 | y字段: do | ||
18 | 数字 = 100 | ||
19 | (参数x) -> 参数x + 数字 | ||
20 | } | ||
21 | |||
22 | (参数y=(do | ||
23 | 变量x = 10 + 2 | ||
24 | 变量x), 参数k=do | ||
25 | "没啥") -> do | ||
26 | "啊" | ||
27 | |||
diff --git a/spec/inputs/unicode/existential.yue b/spec/inputs/unicode/existential.yue new file mode 100644 index 0000000..0e35a39 --- /dev/null +++ b/spec/inputs/unicode/existential.yue | |||
@@ -0,0 +1,58 @@ | |||
1 | |||
2 | 函数1?! | ||
3 | |||
4 | 函数2? "参数0",123 | ||
5 | |||
6 | 变量x = 表?.值 | ||
7 | |||
8 | 打印 对象abc?["你好 世界"]?.字段xyz | ||
9 | |||
10 | if 打印 and 变量x? | ||
11 | 打印 变量x | ||
12 | |||
13 | @?\函数 998 | ||
14 | |||
15 | with 对象abc?!\函数?! | ||
16 | if \函数p? "abc" | ||
17 | return 123 | ||
18 | |||
19 | if {:x字段} = 对象a?.如果?\然后?(123)? @?\方法 998 | ||
20 | 打印 x字段 | ||
21 | |||
22 | 结果 = 对象b.方法\执行!\当?("没问题")\如果("默认",998)\函数? | ||
23 | 打印 结果 | ||
24 | |||
25 | 自我为中心 = true if 思想? and not 世界? | ||
26 | |||
27 | 速度 = 0 | ||
28 | 速度 or= 15 | ||
29 | |||
30 | 脚印 = 野人 or "熊" | ||
31 | |||
32 | 专业 = '计算机科学' | ||
33 | |||
34 | unless 专业? | ||
35 | 选修课程 '葡萄酒入门' | ||
36 | |||
37 | if 窗体? | ||
38 | 环境 = '浏览器(有可能)' | ||
39 | |||
40 | 邮编 = 抽奖.中奖者?!.地址?.邮政编码 | ||
41 | |||
42 | 长度 = utf8?.长度 or 字符串?.长度 or (对象) -> #对象 | ||
43 | |||
44 | 变量a = 表1?\结束? 123 + 表2?\然后 456 | ||
45 | |||
46 | 变量b = 表1?\结束? or 表2?\然后 | ||
47 | |||
48 | with? io.open "测试.txt", "w" | ||
49 | \write "你好" | ||
50 | \close! | ||
51 | |||
52 | 表?.<call>? 123 | ||
53 | |||
54 | with? 表.<>?.<index> | ||
55 | .字段a = 1 | ||
56 | |||
57 | nil | ||
58 | |||
diff --git a/spec/inputs/unicode/export.yue b/spec/inputs/unicode/export.yue new file mode 100644 index 0000000..151c5f5 --- /dev/null +++ b/spec/inputs/unicode/export.yue | |||
@@ -0,0 +1,90 @@ | |||
1 | |||
2 | export 变量a,变量b,变量c = 223, 343, 123 | ||
3 | export 酷 = "🧧" | ||
4 | |||
5 | 变量d,变量e,变量f = 3, 2, 1 | ||
6 | export 变量d, 变量e, 变量f | ||
7 | |||
8 | export class 某类 | ||
9 | 嗯: "酷" | ||
10 | |||
11 | export if 这个 | ||
12 | 232 | ||
13 | else | ||
14 | 4343 | ||
15 | |||
16 | export 什么 = if 这个 | ||
17 | 232 | ||
18 | else | ||
19 | 4343 | ||
20 | |||
21 | export 变量y = -> | ||
22 | 你好 = 3434 | ||
23 | |||
24 | export with 临时 | ||
25 | 变量j = 2000 | ||
26 | |||
27 | export cb的值 = do | ||
28 | 变量h = 100 | ||
29 | (参数)<- 函数 | ||
30 | return 参数 h变量 | ||
31 | |||
32 | export 丫丫 = -> | ||
33 | 变量h = 100 | ||
34 | 变量k = 100 | ||
35 | |||
36 | export switch 变量h | ||
37 | when 100, 150 then 200 | ||
38 | when 200 then 300 | ||
39 | else 0 | ||
40 | |||
41 | export 常量 = switch 值 | ||
42 | when "好" then 1 | ||
43 | when "更好" then 2 | ||
44 | when "最好" then 3 | ||
45 | |||
46 | export 项目 = 123 | ||
47 | |> 函数 | ||
48 | |||
49 | export 变量x | ||
50 | |||
51 | 函数 if 条件a then 值b | ||
52 | 函数 do 123 | ||
53 | 函数 switch 对象a | ||
54 | when 变量b then 值c | ||
55 | 函数 [计数 for 计数 = 1,10] | ||
56 | 函数 for 计数 = 1,10 do 计数 | ||
57 | 函数 {键,值 for 键,值 in pairs 表} | ||
58 | 函数 for 键,值 in pairs 表 do {键,值} | ||
59 | 函数 while 条件a do true | ||
60 | 函数 with 条件a | ||
61 | .字段b = 123 | ||
62 | 函数 对象a?.字段b | ||
63 | 函数 对象a\字段b | ||
64 | 函数 class A类 | ||
65 | |||
66 | _ = "#{if 条件a then 值b}" | ||
67 | _ = "#{do 123}" | ||
68 | _ = "#{switch 对象a | ||
69 | when 变量b then 值c}" | ||
70 | _ = "#{[计数 for 计数 = 1,10]}" | ||
71 | _ = "#{for 计数 = 1,10 do 计数}" | ||
72 | _ = "#{{键,值 for 键,值 in pairs 表}}" | ||
73 | _ = "#{for 键,值 in pairs 表 do {键,值}}" | ||
74 | _ = "#{while 条件a do true}" | ||
75 | _ = "#{with 对象a | ||
76 | .字段b = 123}" | ||
77 | _ = "#{对象a?.字段b}" | ||
78 | _ = "#{对象a\字段b}" | ||
79 | _ = "#{class A类}" | ||
80 | |||
81 | local * | ||
82 | 变量1 = 1 | ||
83 | export 变量2 = 2 | ||
84 | export 变量3 = class 类4 | ||
85 | 变量5 = 5 | ||
86 | |||
87 | export.<"🀄️"> = 1 | ||
88 | export.<name> = "导出" | ||
89 | export.<call> = => {} | ||
90 | export["导出-任意-名称"] = 123 | ||
diff --git a/spec/inputs/unicode/export_default.yue b/spec/inputs/unicode/export_default.yue new file mode 100644 index 0000000..74ec10e --- /dev/null +++ b/spec/inputs/unicode/export_default.yue | |||
@@ -0,0 +1,15 @@ | |||
1 | |||
2 | 打印 "没问题" | ||
3 | |||
4 | export default -> | ||
5 | 打印 "你好" | ||
6 | 123 | ||
7 | |||
8 | (参数x, 回调y)<- 函数 123, "abc" unless 是否结束 | ||
9 | 打印 参数x | ||
10 | (参数y, 结果)<- 回调y | ||
11 | return if 结果 | ||
12 | 变量abc + 参数y | ||
13 | else | ||
14 | 变量abc | ||
15 | |||
diff --git a/spec/inputs/unicode/funcs.yue b/spec/inputs/unicode/funcs.yue new file mode 100644 index 0000000..c563356 --- /dev/null +++ b/spec/inputs/unicode/funcs.yue | |||
@@ -0,0 +1,161 @@ | |||
1 | |||
2 | |||
3 | 变量x = -> 打印 什么 | ||
4 | |||
5 | _无效变量 = -> | ||
6 | |||
7 | _无效变量 = -> -> -> | ||
8 | |||
9 | 到 谷 仓 去 | ||
10 | |||
11 | 开 -> 这扇 -> 门 | ||
12 | |||
13 | 开 -> | ||
14 | 这扇 门 | ||
15 | 你好 = -> | ||
16 | 我的 函数 | ||
17 | |||
18 | 变量h = -> 👋 | ||
19 | |||
20 | 吃 ->, 世界 | ||
21 | |||
22 | |||
23 | (->)() | ||
24 | |||
25 | 变量x = (...) -> | ||
26 | |||
27 | 你好! | ||
28 | 你好.世界! | ||
29 | |||
30 | _无效变量 = 你好!.某物 | ||
31 | _无效变量 = 什么!["🥵🥵🥵"] | ||
32 | |||
33 | 什! 么! 情况! | ||
34 | |||
35 | _无效变量 = (参数a,参数b,参数c,参数d,参数e) -> | ||
36 | |||
37 | _无效变量 = (参数,参数,参数,参数,参数) -> | ||
38 | 打印 参数 | ||
39 | |||
40 | _无效变量 = (参数x=23023) -> | ||
41 | |||
42 | _无效变量 = (参数x=(参数y=()->) ->) -> | ||
43 | |||
44 | _无效变量 = (变量x = if 某物 then 好 else 坏) -> | ||
45 | |||
46 | 某物 = (你好=100, 世界=(参数x=[[好 酷]])-> 打印 "吃米饭") -> | ||
47 | 打印 你好 | ||
48 | |||
49 | _无效变量 = () => | ||
50 | _无效变量 = (参数x, 参数y) => | ||
51 | _无效变量 = (@参数x, @参数y) => | ||
52 | _无效变量 = (参数x=1) => | ||
53 | _无效变量 = (@参数x=1,参数y,@参数z="你好 世界") => | ||
54 | |||
55 | |||
56 | 变量x -> return | ||
57 | 变量y -> return 1 | ||
58 | 变量z -> return 1, "你好", "世界" | ||
59 | 变量k -> if 是 then return else return | ||
60 | |||
61 | _无效变量 = -> 真名 if 某物 | ||
62 | |||
63 | -- | ||
64 | |||
65 | 函数d( | ||
66 | -> | ||
67 | 打印 "你好 世界" | ||
68 | 10 | ||
69 | ) | ||
70 | |||
71 | |||
72 | |||
73 | 函数d( | ||
74 | 1,2,3 | ||
75 | 4 | ||
76 | 5 | ||
77 | 6 | ||
78 | |||
79 | if 某物 | ||
80 | 打印 "okay" | ||
81 | 10 | ||
82 | |||
83 | 10,20 | ||
84 | ) | ||
85 | |||
86 | |||
87 | 函数f( | ||
88 | |||
89 | )( | ||
90 | |||
91 | )( | ||
92 | 什么 | ||
93 | )(-> | ||
94 | 打印 "srue" | ||
95 | 123) | ||
96 | |||
97 | -- | ||
98 | |||
99 | 变量x = (参数a, | ||
100 | 参数b) -> | ||
101 | 打印 "什么" | ||
102 | |||
103 | |||
104 | 变量y = (参数a="hi", | ||
105 | 参数b=23) -> | ||
106 | 打印 "什么" | ||
107 | |||
108 | 变量z = ( | ||
109 | 参数a="hi", | ||
110 | 参数b=23) -> | ||
111 | 打印 "什么" | ||
112 | |||
113 | |||
114 | 变量j = (参数f,参数g,参数m, | ||
115 | 参数a="hi", | ||
116 | 参数b=23 | ||
117 | ) -> | ||
118 | 打印 "什么" | ||
119 | |||
120 | |||
121 | 变量y = (参数a="hi", | ||
122 | 参数b=23, | ||
123 | ...) -> | ||
124 | 打印 "什么" | ||
125 | |||
126 | |||
127 | 变量y = (参数a="hi", | ||
128 | 参数b=23, | ||
129 | ... | ||
130 | ) -> | ||
131 | 打印 "什么" | ||
132 | |||
133 | -- | ||
134 | |||
135 | 多参数 = (参数a | ||
136 | 参数b) -> | ||
137 | 打印 "什么" | ||
138 | |||
139 | |||
140 | 多参数 = (参数a="hi" | ||
141 | 参数b=23) -> | ||
142 | 打印 "什么" | ||
143 | |||
144 | 多参数 = ( | ||
145 | 参数a="hi" | ||
146 | 参数b=23) -> | ||
147 | 打印 "什么" | ||
148 | |||
149 | |||
150 | 多参数 = (参数f,参数g,参数m | ||
151 | 参数a="hi" | ||
152 | 参数b=23 | ||
153 | ) -> | ||
154 | 打印 "什么" | ||
155 | |||
156 | |||
157 | @ = (参数n)-> | ||
158 | return 1 if 参数n == 0 | ||
159 | 参数n * @(参数n-1) | ||
160 | |||
161 | nil | ||
diff --git a/spec/inputs/unicode/global.yue b/spec/inputs/unicode/global.yue new file mode 100644 index 0000000..6ababde --- /dev/null +++ b/spec/inputs/unicode/global.yue | |||
@@ -0,0 +1,77 @@ | |||
1 | |||
2 | do | ||
3 | global 全局变量a,全局变量b,全局变量c = 223, 343, nil | ||
4 | global 酷 = "📉" | ||
5 | |||
6 | do | ||
7 | global class 全局类 | ||
8 | 嗯: "🆒" | ||
9 | |||
10 | do | ||
11 | global 全局变量a,全局变量b,全局变量c | ||
12 | 全局变量a,全局变量b,变量c,变量d = "你好", nil, nil, nil | ||
13 | |||
14 | |||
15 | do | ||
16 | 什么 = if 这个 | ||
17 | 232 | ||
18 | else | ||
19 | 4343 | ||
20 | |||
21 | global ^ | ||
22 | |||
23 | 另一个 = 3434 | ||
24 | A另一个 = 7890 | ||
25 | |||
26 | if 内部 then Y好 = "10000" | ||
27 | |||
28 | 什么 = if 这个 | ||
29 | 232 | ||
30 | else | ||
31 | 4343 | ||
32 | |||
33 | |||
34 | do | ||
35 | global * | ||
36 | |||
37 | 什么 = if 这个 | ||
38 | 232 | ||
39 | else | ||
40 | 4343 | ||
41 | |||
42 | 全局变量x,全局变量y,全局变量z = 1,2,3 | ||
43 | |||
44 | 全局变量y = -> | ||
45 | 好的 = 3434 | ||
46 | |||
47 | with 全局临时变量 | ||
48 | 变量j = 2000 | ||
49 | |||
50 | |||
51 | do | ||
52 | global * | ||
53 | 变量x = 3434 | ||
54 | if 条件y then | ||
55 | 变量x = 10 | ||
56 | |||
57 | do | ||
58 | global * | ||
59 | if 条件y then | ||
60 | 变量x = 10 | ||
61 | 变量x = 3434 | ||
62 | |||
63 | do | ||
64 | do | ||
65 | global * | ||
66 | |||
67 | 变量k = 1212 | ||
68 | |||
69 | do | ||
70 | 变量h = 100 | ||
71 | |||
72 | 全局变量y = -> | ||
73 | 变量h = 100 | ||
74 | 变量k = 100 | ||
75 | |||
76 | 变量h = 100 | ||
77 | |||
diff --git a/spec/inputs/unicode/goto.yue b/spec/inputs/unicode/goto.yue new file mode 100644 index 0000000..8cba358 --- /dev/null +++ b/spec/inputs/unicode/goto.yue | |||
@@ -0,0 +1,41 @@ | |||
1 | do | ||
2 | 变量a = 0 | ||
3 | ::开始:: | ||
4 | 变量a += 1 | ||
5 | goto 结束 if 变量a == 5 | ||
6 | goto 开始 | ||
7 | ::结束:: | ||
8 | |||
9 | do | ||
10 | for 计数z = 1, 10 do for 计数y = 1, 10 do for 计数x = 1, 10 | ||
11 | if 计数x^2 + 计数y^2 == 计数z^2 | ||
12 | 打印 '找到了毕达哥拉斯三元组:', 计数x, 计数y, 计数z | ||
13 | goto 完成 | ||
14 | ::完成:: | ||
15 | |||
16 | do | ||
17 | for 计数z = 1, 10 | ||
18 | for 计数y = 1, 10 do for 计数x = 1, 10 | ||
19 | if 计数x^2 + 计数y^2 == 计数z^2 | ||
20 | 打印 '找到了毕达哥拉斯三元组:', 计数x, 计数y, 计数z | ||
21 | 打印 'now trying next z...' | ||
22 | goto 继续z | ||
23 | ::继续z:: | ||
24 | |||
25 | do | ||
26 | ::重做:: | ||
27 | for 计数x = 1, 10 do for 计数y = 1, 10 | ||
28 | if not 函数f 计数x, 计数y then goto 继续 | ||
29 | if not 函数g 计数x, 计数y then goto 跳过 | ||
30 | if not 函数h 计数x, 计数y then goto 重做 | ||
31 | ::继续:: | ||
32 | ::跳过:: | ||
33 | |||
34 | do | ||
35 | for 变量 in *列表 | ||
36 | if 变量 % 2 == 0 | ||
37 | 打印 '列表有偶数' | ||
38 | goto 有 | ||
39 | 打印 '列表没偶数' | ||
40 | ::有:: | ||
41 | |||
diff --git a/spec/inputs/unicode/import.yue b/spec/inputs/unicode/import.yue new file mode 100644 index 0000000..c229edb --- /dev/null +++ b/spec/inputs/unicode/import.yue | |||
@@ -0,0 +1,78 @@ | |||
1 | |||
2 | |||
3 | import 你好 from 好的 | ||
4 | import 好呀, 世界 from 表["酷"] | ||
5 | |||
6 | import 字段x, \字段y, 字段z from 道具组 | ||
7 | |||
8 | import 领主, \👻 from 找到 "我的表" | ||
9 | |||
10 | _obj_0 = 232 | ||
11 | |||
12 | import 某物 from 一个 表格 | ||
13 | |||
14 | |||
15 | if 缩进 | ||
16 | import 好吧, \很好 from 很多表[100] | ||
17 | |||
18 | do | ||
19 | import 字段a, 字段b, 字段c from 对象z | ||
20 | |||
21 | do | ||
22 | import 字段a, | ||
23 | 字段b, 字段c from 对象z | ||
24 | |||
25 | do | ||
26 | import 字段a | ||
27 | 字段b | ||
28 | 字段c from 对象z | ||
29 | |||
30 | do | ||
31 | import | ||
32 | 字段a | ||
33 | 字段b | ||
34 | 字段c from 对象z | ||
35 | |||
36 | |||
37 | do | ||
38 | import | ||
39 | 字段a | ||
40 | 字段b | ||
41 | 字段c | ||
42 | from 对象z | ||
43 | |||
44 | |||
45 | do | ||
46 | import '模块' | ||
47 | 打印 模块 | ||
48 | import '模块_x' | ||
49 | 打印 模块_x | ||
50 | import "下-划-线-模-块-啊" | ||
51 | 打印 下_划_线_模_块_啊 | ||
52 | import "模块.子模块" | ||
53 | 打印 子模块 | ||
54 | |||
55 | do | ||
56 | import "小玩家" as 大玩家 | ||
57 | import "lpeg库" as {:C, :Ct, :Cmt} | ||
58 | import "导出" as {一, 二, 某键:{嗯:{字符}}} | ||
59 | import "导出" as :又一个组件 | ||
60 | 打印 又一个组件 | ||
61 | |||
62 | do | ||
63 | global * | ||
64 | import '模块' | ||
65 | import '模块_x' | ||
66 | import "组织.包.模块-y" | ||
67 | 打印 模块_y | ||
68 | |||
69 | do | ||
70 | import "组织.包.模块" as 函数体:函数, 如果:如果变量 | ||
71 | |||
72 | do | ||
73 | import "块" as {<gc>: 变量b} | ||
74 | import "块" as {:<index>} | ||
75 | import "块" as {字段e: 变量f, <pairs>: 变量c} | ||
76 | import "块" as {字段c: 变量d} | ||
77 | import "块" as {元素g, {<close>: 变量i}} | ||
78 | |||
diff --git a/spec/inputs/unicode/in_expression.yue b/spec/inputs/unicode/in_expression.yue new file mode 100644 index 0000000..efaca47 --- /dev/null +++ b/spec/inputs/unicode/in_expression.yue | |||
@@ -0,0 +1,52 @@ | |||
1 | -变量a^2 in {1, 2, 3} |> 函数 | ||
2 | |||
3 | 变量a, 变量b = 函数x(...) not in [1, 3], 2 | ||
4 | |||
5 | 变量d = (对象.字段x.字段y ...) not in [1, 3] | ||
6 | |||
7 | 在的 = "东" in { "东", "西" } | ||
8 | |||
9 | if 变量a in {1} and 变量b in {2, 3, 4} or 变量c in [1, 10] | ||
10 | 打印 变量a, 变量b, 变量c | ||
11 | |||
12 | switch 值 | ||
13 | when 1, 2, 3 | ||
14 | 打印 "1, 2, 3" | ||
15 | |||
16 | when not in (0, 100] | ||
17 | 打印 "非 (0 < 值 <= 100)" | ||
18 | |||
19 | when in [200, 300) | ||
20 | 打印 "200 <= 值 < 300)" | ||
21 | |||
22 | when not in {333, 444, 555} | ||
23 | 打印 "非 333, 444 或 555" | ||
24 | |||
25 | do return 变量y not in (开始, 结束) | ||
26 | |||
27 | do | ||
28 | 存在 = 元素 in 表 | ||
29 | 检查 元素 in 表 | ||
30 | |||
31 | do | ||
32 | 对象 = 获取! | ||
33 | 存在 = 元素 in 表 | ||
34 | 检查 元素 in 表 | ||
35 | |||
36 | do | ||
37 | 对象 = 获取! | ||
38 | 列表 = {1, 2, 3} | ||
39 | 不存在 = 元素 not in 列表 | ||
40 | 检查 元素 in 列表 | ||
41 | 检查 元素 in {1, 2, 3} | ||
42 | 检查 元素(...) in {[1]: 1, [2]: 2, [3]: 3} | ||
43 | |||
44 | do | ||
45 | 检查 -> 对象x in 数组tb | ||
46 | 检查 -> 对象x not in 数组tb | ||
47 | local 对象x, 数组tb | ||
48 | 检查 -> return 对象x in 数组tb | ||
49 | 检查 -> 对象x not in 数组tb | ||
50 | |||
51 | nil | ||
52 | |||
diff --git a/spec/inputs/unicode/lists.yue b/spec/inputs/unicode/lists.yue new file mode 100644 index 0000000..6c3200b --- /dev/null +++ b/spec/inputs/unicode/lists.yue | |||
@@ -0,0 +1,67 @@ | |||
1 | |||
2 | 你好 = [变量x*2 for _, 变量x in ipairs{1,2,3,4}] | ||
3 | |||
4 | 物品 = {1,2,3,4,5,6} | ||
5 | |||
6 | _ = [变量z for 变量z in ipairs 物品 when 变量z > 4] | ||
7 | |||
8 | 半径 = [{变量a} for 变量a in ipairs { | ||
9 | 1,2,3,4,5,6, | ||
10 | } when 好数字 变量a] | ||
11 | |||
12 | _ = [变量z for 变量z in 物品 for 变量j in 列表 when 变量z > 4] | ||
13 | |||
14 | require "实用" | ||
15 | |||
16 | 倾倒 = (变量x) -> 打印 实用.倾倒 变量x | ||
17 | |||
18 | 范围 = (数量) -> | ||
19 | 变量i = 0 | ||
20 | return coroutine.wrap -> | ||
21 | while 变量i < 数量 | ||
22 | coroutine.yield 变量i | ||
23 | 变量i = 变量i + 1 | ||
24 | |||
25 | 倾倒 [变量x for 变量x in 范围 10] | ||
26 | 倾倒 [{变量x, 变量y} for 变量x in 范围 5 when 变量x > 2 for 变量y in 范围 5] | ||
27 | |||
28 | 东西 = [变量x + 变量y for 变量x in 范围 10 when 变量x > 5 for 变量y in 范围 10 when 变量y > 7] | ||
29 | |||
30 | 打印 变量x, 变量y for 变量x in ipairs{1,2,4} for 变量y in ipairs{1,2,3} when 变量x != 2 | ||
31 | |||
32 | 打印 "你好", 变量x for 变量x in 物品 | ||
33 | |||
34 | _ = [变量x for 变量x in 变量x] | ||
35 | 变量x = [变量x for 变量x in 变量x] | ||
36 | |||
37 | 打印 变量x, 变量y for 变量x in ipairs{1,2,4} for 变量y in ipairs{1,2,3} when 变量x != 2 | ||
38 | |||
39 | 双倍 = [变量x*2 for 变量x in *物品] | ||
40 | |||
41 | 打印 变量x for 变量x in *双倍 | ||
42 | |||
43 | 切 = [变量x for 变量x in *物品 when 变量x > 3] | ||
44 | |||
45 | 你好 = [变量x + 变量y for 变量x in *物品 for 变量y in *物品] | ||
46 | |||
47 | 打印 变量z for 变量z in *你好 | ||
48 | |||
49 | -- 切片 | ||
50 | 变量x = {1, 2, 3, 4, 5, 6, 7} | ||
51 | 打印 变量y for 变量y in *变量x[2,-5,2] | ||
52 | 打印 变量y for 变量y in *变量x[,3] | ||
53 | 打印 变量y for 变量y in *变量x[2,] | ||
54 | 打印 变量y for 变量y in *变量x[,,2] | ||
55 | 打印 变量y for 变量y in *变量x[2,,2] | ||
56 | |||
57 | 变量a, 变量b, 变量c = 1, 5, 2 | ||
58 | 打印 变量y for 变量y in *变量x[变量a,变量b,变量c] | ||
59 | |||
60 | 正常 = (你好) -> | ||
61 | [变量x for 变量x in 嗯哼] | ||
62 | |||
63 | 测试 = 变量x 1,2,3,4,5 | ||
64 | 打印 事情 for 事情 in *测试 | ||
65 | |||
66 | -> 变量a = 变量b for 行 in *行们 | ||
67 | |||
diff --git a/spec/inputs/unicode/literals.yue b/spec/inputs/unicode/literals.yue new file mode 100644 index 0000000..3d58096 --- /dev/null +++ b/spec/inputs/unicode/literals.yue | |||
@@ -0,0 +1,55 @@ | |||
1 | |||
2 | 数据 = { | ||
3 | 121 | ||
4 | 121.2323 | ||
5 | 121.2323e-1 | ||
6 | 121.2323e13434 | ||
7 | 2323E34 | ||
8 | 0x12323 | ||
9 | |||
10 | 0xfF2323 | ||
11 | 0xabcdef | ||
12 | 0xABCDEF | ||
13 | 0x123p-123 | ||
14 | 0xABCP+321 | ||
15 | 0x.1p-111 | ||
16 | 0xA_B_CP-3_2_1 | ||
17 | |||
18 | .2323 | ||
19 | .2323e-1 | ||
20 | .2323e13434 | ||
21 | |||
22 | |||
23 | 1LL | ||
24 | 1ULL | ||
25 | 9332LL | ||
26 | 9332 | ||
27 | 0x2aLL | ||
28 | 0x2aULL | ||
29 | |||
30 | 1_000_000.000_000_1 | ||
31 | 1_234e567_8 | ||
32 | 1_234E-567_8 | ||
33 | 0xDE_AD_BE_EF | ||
34 | |||
35 | [[ 你好 世界 ]] | ||
36 | |||
37 | [=[ 你好 世界 ]=] | ||
38 | [====[ 你好 世界 ]====] | ||
39 | |||
40 | "另一个 世界" | ||
41 | |||
42 | '哪个 世界' | ||
43 | |||
44 | |||
45 | " | ||
46 | 你好 世界 | ||
47 | " | ||
48 | |||
49 | '是的 | ||
50 | 发生了什么 | ||
51 | 这里有些很酷的东西' | ||
52 | |||
53 | } | ||
54 | 空值 | ||
55 | |||
diff --git a/spec/inputs/unicode/local.yue b/spec/inputs/unicode/local.yue new file mode 100644 index 0000000..b751eb6 --- /dev/null +++ b/spec/inputs/unicode/local.yue | |||
@@ -0,0 +1,91 @@ | |||
1 | |||
2 | do | ||
3 | local 变量a | ||
4 | local 变量a, 变量b, 变量c | ||
5 | |||
6 | 变量b, 变量g = 23232, nil | ||
7 | |||
8 | do | ||
9 | 变量x = 1212 | ||
10 | 某事 = -> | ||
11 | local 变量x | ||
12 | 变量x = 1212 | ||
13 | |||
14 | do | ||
15 | local * | ||
16 | 变量y = 2323 | ||
17 | 变量z = 2323 | ||
18 | |||
19 | do | ||
20 | local * | ||
21 | 打印 "啥也没有!" | ||
22 | |||
23 | do | ||
24 | local ^ | ||
25 | x变量 = 3434 | ||
26 | y变量 = 3434 | ||
27 | X大写 = 3434 | ||
28 | Y大写 = "好" | ||
29 | |||
30 | do | ||
31 | local ^ | ||
32 | x变量, y变量 = "a", "b" | ||
33 | |||
34 | do | ||
35 | local * | ||
36 | x变量, y变量 = "a", "b" | ||
37 | |||
38 | do | ||
39 | local * | ||
40 | if 某事 | ||
41 | x变量 = 2323 | ||
42 | |||
43 | do | ||
44 | local * | ||
45 | do | ||
46 | 变量x = "一" | ||
47 | |||
48 | 变量x = 100 | ||
49 | do | ||
50 | 变量x = "二" | ||
51 | |||
52 | do | ||
53 | local * | ||
54 | 变量k = if 什么 | ||
55 | 10 | ||
56 | 变量x = 100 | ||
57 | {变量a, 变量b, 变量c} = 变量y | ||
58 | |||
59 | do | ||
60 | local * | ||
61 | 变量a = 100 | ||
62 | 打印 "嗨" | ||
63 | 变量b = 200 | ||
64 | local * | ||
65 | 变量c = 100 | ||
66 | 打印 "嗨" | ||
67 | 变量d = 200 | ||
68 | 变量d = 2323 | ||
69 | |||
70 | do | ||
71 | local ^ | ||
72 | a小写 = 5 | ||
73 | A大写 = 3 | ||
74 | |||
75 | class O一 | ||
76 | F五 = 6 | ||
77 | |||
78 | class T二 | ||
79 | class N无 | ||
80 | |||
81 | do | ||
82 | local * | ||
83 | -- this generates a nil value in the body | ||
84 | for 变量a in *{} do _ = 变量a | ||
85 | |||
86 | do | ||
87 | local * | ||
88 | 变量x = 变量a or 变量b | ||
89 | |||
90 | 变量g = 2323 -- test if anything leaked | ||
91 | |||
diff --git a/spec/inputs/unicode/loops.yue b/spec/inputs/unicode/loops.yue new file mode 100644 index 0000000..ab01232 --- /dev/null +++ b/spec/inputs/unicode/loops.yue | |||
@@ -0,0 +1,194 @@ | |||
1 | |||
2 | for 变量x=1,10 | ||
3 | 打印 "yeah" | ||
4 | |||
5 | for 变量x=1,#某物 | ||
6 | 打印 "yeah" | ||
7 | |||
8 | for 变量y=100,60,-3 | ||
9 | 打印 "倒计时", 变量y | ||
10 | |||
11 | for 变量a=1,10 do 打印 "好的" | ||
12 | |||
13 | for 变量a=1,10 | ||
14 | for 变量b = 2,43 | ||
15 | 打印 变量a,变量b | ||
16 | |||
17 | for 变量i in 迭代器 | ||
18 | for 变量j in 是的 | ||
19 | 变量x = 343 + 变量i + 变量j | ||
20 | 打印 变量i, 变量j | ||
21 | |||
22 | for 变量x in *某物 | ||
23 | 打印 变量x | ||
24 | |||
25 | for 键,值 in pairs 你好 do 打印 键,值 | ||
26 | |||
27 | for 变量x in 变量y, 变量z | ||
28 | 打印 变量x | ||
29 | |||
30 | for 变量x in 变量y, 变量z, 键 | ||
31 | 打印 变量x | ||
32 | |||
33 | for 名称, 成员们 in *模块 | ||
34 | 打印 名称, 成员 | ||
35 | |||
36 | 变量x = -> | ||
37 | for 变量x in 变量y | ||
38 | 变量_ = 变量y | ||
39 | |||
40 | 你好 = {1,2,3,4,5} | ||
41 | |||
42 | 变量x = for 变量y in *你好 | ||
43 | if 变量y % 2 == 0 | ||
44 | 变量y | ||
45 | |||
46 | 变量x = -> | ||
47 | for 变量x in *你好 | ||
48 | 变量_ = 变量y | ||
49 | |||
50 | 表格 = for 变量i=10,20 do 变量i * 2 | ||
51 | |||
52 | 哦 = 0 | ||
53 | 变量y = for 变量j = 3,30, 8 | ||
54 | 哦 += 1 | ||
55 | 变量j * 哦 | ||
56 | |||
57 | 变量_ = -> | ||
58 | for 变量k=10,40 | ||
59 | 变量_ = "好的" | ||
60 | |||
61 | 变量_ = -> | ||
62 | return for 变量k=10,40 | ||
63 | "好的" | ||
64 | |||
65 | while true do 打印 "名称" | ||
66 | |||
67 | while 5 + 5 | ||
68 | 打印 "好的 世界" | ||
69 | 工作 人 | ||
70 | |||
71 | while 还有 do | ||
72 | 我 也 工作 | ||
73 | 变量_ = "好的" | ||
74 | |||
75 | 变量i = 0 | ||
76 | 变量x = while 变量i < 10 | ||
77 | 变量i += 1 | ||
78 | 变量i | ||
79 | |||
80 | -- values that can't be coerced | ||
81 | |||
82 | 变量x = for 东西 in *3 | ||
83 | 变量y = "你好" | ||
84 | break | ||
85 | |||
86 | 变量x = for 变量x=1,2 | ||
87 | 变量y = "你好" | ||
88 | 变量y | ||
89 | |||
90 | -- continue | ||
91 | |||
92 | while true | ||
93 | continue if false | ||
94 | 打印 "是的" | ||
95 | break if true | ||
96 | 打印 "不" | ||
97 | |||
98 | for 变量i = 1, 10 | ||
99 | while true | ||
100 | if not true | ||
101 | continue | ||
102 | break | ||
103 | |||
104 | 变量a = 1 | ||
105 | repeat | ||
106 | 变量a += 1 | ||
107 | if 变量a == 5 | ||
108 | continue | ||
109 | if 变量a == 6 | ||
110 | break | ||
111 | 打印 变量a | ||
112 | until 变量a == 10 | ||
113 | |||
114 | 变量x = 0 | ||
115 | repeat | ||
116 | 变量x += 1 | ||
117 | 变量y = 变量x | ||
118 | continue if 变量x < 5 | ||
119 | 打印 变量y | ||
120 | until 变量y == 10 | ||
121 | |||
122 | 变量a = 3 | ||
123 | until 变量a == 0 | ||
124 | 变量a -= 1 | ||
125 | 完成 = false | ||
126 | until 完成 do 完成 = true | ||
127 | repeat | ||
128 | 打印 "你好" | ||
129 | until true | ||
130 | until 完成 | ||
131 | 变量x = 10 | ||
132 | repeat | ||
133 | 变量x -= 1 | ||
134 | until 变量x == 0 | ||
135 | until 条件 | ||
136 | 打印 "好的" | ||
137 | |||
138 | for 变量x=1,10 | ||
139 | continue if 变量x > 3 and 变量x < 7 | ||
140 | 打印 变量x | ||
141 | |||
142 | 列表 = for 变量x=1,10 | ||
143 | continue if 变量x > 3 and 变量x < 7 | ||
144 | 变量x | ||
145 | |||
146 | for 变量a in *{1,2,3,4,5,6} | ||
147 | continue if 变量a == 1 | ||
148 | continue if 变量a == 3 | ||
149 | 打印 变量a | ||
150 | |||
151 | for 变量x=1,10 | ||
152 | continue if 变量x % 2 == 0 | ||
153 | for 变量y = 2,12 | ||
154 | continue if 变量y % 3 == 0 | ||
155 | |||
156 | while true | ||
157 | continue if false | ||
158 | break | ||
159 | |||
160 | while true | ||
161 | continue if false | ||
162 | return 22 | ||
163 | |||
164 | -- | ||
165 | |||
166 | do | ||
167 | 三重x = {1,2,3,4} | ||
168 | for 东西 in *三重x | ||
169 | 打印 东西 | ||
170 | |||
171 | do | ||
172 | for 变量i = 1, 10 | ||
173 | repeat | ||
174 | with? 对象tb | ||
175 | .字段a = 1 | ||
176 | continue if .字段b | ||
177 | do | ||
178 | if .字段c | ||
179 | break | ||
180 | until true | ||
181 | switch 变量x | ||
182 | when 123 | ||
183 | break | ||
184 | else | ||
185 | continue | ||
186 | if 变量y | ||
187 | continue | ||
188 | else | ||
189 | break | ||
190 | do do do | ||
191 | 打印 变量i | ||
192 | continue | ||
193 | 打印 "abc" | ||
194 | |||
diff --git a/spec/inputs/unicode/macro.yue b/spec/inputs/unicode/macro.yue new file mode 100644 index 0000000..79d3c07 --- /dev/null +++ b/spec/inputs/unicode/macro.yue | |||
@@ -0,0 +1,291 @@ | |||
1 | import "unicode.macro_export" as { | ||
2 | $, -- import all macros | ||
3 | $配置: $我的配置, -- rename macro $config to $myconfig | ||
4 | } | ||
5 | |||
6 | import "unicode.macro_todo" as $ | ||
7 | |||
8 | $断言集 对象 == nil | ||
9 | |||
10 | $我的配置 false | ||
11 | |||
12 | 结果 = $断言 对象 == nil | ||
13 | |||
14 | macro 和 = (...)-> | ||
15 | 值们 = [元素 for 元素 in *{...}] | ||
16 | $显示宏 "和", "#{ table.concat 值们, " and " }" | ||
17 | |||
18 | if $和 函数1! | ||
19 | 打印 "没问题" | ||
20 | |||
21 | if $和 函数1!, 函数2!, 函数3! | ||
22 | 打印 "没问题" | ||
23 | |||
24 | 对象 = $复制( | ||
25 | @ | ||
26 | {位置: {}, 标签: 标签::转数字!} | ||
27 | 标识 | ||
28 | 连接们 | ||
29 | 位置.x坐标 | ||
30 | 位置.y坐标 | ||
31 | 位置.z坐标 | ||
32 | ) | ||
33 | |||
34 | macro 在 = (目标, ...)-> | ||
35 | 值们 = [元素 for 元素 in *{...}] | ||
36 | $显示宏 "在", table.concat ["#{目标} == #{值}" for 值 in *值们], " or " | ||
37 | |||
38 | if 变量x |> $在 "🍎", "🐷", "🐶" | ||
39 | 打印 "存在" | ||
40 | |||
41 | macro 映射 = (数组, 动作)-> | ||
42 | $显示宏 "映射", "[#{动作} for _ in *#{数组}]" | ||
43 | |||
44 | macro 过滤 = (数组, 动作)-> | ||
45 | $显示宏 "过滤", "[_ for _ in *#{数组} when #{动作}]" | ||
46 | |||
47 | macro 合并 = (数组, 默认值, 动作)-> | ||
48 | $显示宏 "合并", "if ##{数组} == 0 | ||
49 | #{默认值} | ||
50 | else | ||
51 | _1 = #{默认值} | ||
52 | for _2 in *#{数组} | ||
53 | _1 = #{动作} | ||
54 | _1" | ||
55 | |||
56 | macro 每一个 = (数组, 动作)-> | ||
57 | $显示宏 "每一个", "for _ in *#{数组} | ||
58 | #{动作}" | ||
59 | |||
60 | macro 管道 = (...)-> | ||
61 | switch select "#", ... | ||
62 | when 0 then return "" | ||
63 | when 1 then return ... | ||
64 | 操作数组 = {...} | ||
65 | 最后一个 = 操作数组[1] | ||
66 | 声明数组 = for 计数 = 2, #操作数组 | ||
67 | 声明 = "\tlocal _#{计数} = #{最后一个} |> #{操作数组[计数]}" | ||
68 | 最后一个 = "_#{计数}" | ||
69 | 声明 | ||
70 | 结果 = "do | ||
71 | #{table.concat 声明数组, "\n"} | ||
72 | #{最后一个}" | ||
73 | $显示宏 "管道", 结果 | ||
74 | |||
75 | {1,2,3} |> $映射(_ * 2) |> $过滤(_ > 4) |> $每一个 打印 _ | ||
76 | |||
77 | $每一个 $过滤($映射({1,2,3}, _ * 2), _ > 4), 打印 _ | ||
78 | |||
79 | 值 = $管道( | ||
80 | {1, 2, 3} | ||
81 | [[$映射(_ * 2)]] | ||
82 | [[$过滤(_ > 4)]] | ||
83 | [[$合并(0, _1 + _2)]] | ||
84 | ) | ||
85 | |||
86 | macro 加 = (参数a, 参数b)-> "#{参数a} + #{参数b}" | ||
87 | |||
88 | $加(1,2)\调用 123 | ||
89 | |||
90 | 结果 = 1 |> $加 2 | ||
91 | |||
92 | macro 柯里化 = (...)-> | ||
93 | 参数数组 = {...} | ||
94 | 长度 = #参数数组 | ||
95 | 主体 = 参数数组[长度] | ||
96 | 定义 = table.concat ["(#{参数数组[计数]})->" for 计数 = 1, 长度 - 1] | ||
97 | "#{定义}\n#{主体\gsub "^do%s*\n",""}" | ||
98 | |||
99 | f = $柯里化 参数x,参数y,参数z,do | ||
100 | 打印 参数x,参数y,参数z | ||
101 | |||
102 | macro 获取里值 = (值)-> "do | ||
103 | 变量a = 1 | ||
104 | 变量a + 1" | ||
105 | |||
106 | macro 获取里值_保持卫生 = (值)-> "(-> | ||
107 | local 变量a = 1 | ||
108 | 变量a + 1)!" | ||
109 | |||
110 | do | ||
111 | 变量a = 8 | ||
112 | 变量a = $获取里值! | ||
113 | 变量a += $获取里值! | ||
114 | 打印 变量a | ||
115 | |||
116 | do | ||
117 | 变量a = 8 | ||
118 | 变量a = $获取里值_保持卫生! | ||
119 | 变量a += $获取里值_保持卫生! | ||
120 | 打印 变量a | ||
121 | |||
122 | macro Lua代码 = (代码)-> { | ||
123 | code: 代码 | ||
124 | type: "lua" | ||
125 | } | ||
126 | |||
127 | 变量x = 0 | ||
128 | |||
129 | $Lua代码 [[ | ||
130 | local function f(a) | ||
131 | return a + 1 | ||
132 | end | ||
133 | x = x + f(3) | ||
134 | ]] | ||
135 | |||
136 | $Lua代码[[ | ||
137 | function tb:func() | ||
138 | print(123) | ||
139 | end | ||
140 | ]] | ||
141 | |||
142 | 打印 变量x | ||
143 | |||
144 | macro 定义函数 = (函数名, ...)-> | ||
145 | 参数数组 = {...} | ||
146 | 最后一个 = table.remove 参数数组 | ||
147 | { | ||
148 | code: $显示宏 "定义函数", "local function #{函数名}(#{table.concat 参数数组, ', '}) | ||
149 | #{最后一个} | ||
150 | end" | ||
151 | type: "lua" | ||
152 | } | ||
153 | |||
154 | sel = (参数a, 参数b, 参数c)-> if 参数a then 参数b else 参数c | ||
155 | |||
156 | $定义函数 sel, a, b, c, [[ | ||
157 | if a then | ||
158 | return b | ||
159 | else | ||
160 | return c | ||
161 | end | ||
162 | ]] | ||
163 | |||
164 | $定义函数 dummy,[[]] | ||
165 | |||
166 | macro 插入注释 = (文本)-> { | ||
167 | code: "-- #{文本\match '[\'"](.*)[\'"]'}" | ||
168 | type: "lua" | ||
169 | } | ||
170 | |||
171 | $插入注释 "这有个注释" | ||
172 | |||
173 | import '下划线' as _ | ||
174 | |||
175 | macro 链式调用 = (...)-> | ||
176 | 主调用 = nil | ||
177 | for 元素 in *{...} | ||
178 | 主调用 = 主调用? and "(#{主调用})\\#{元素}" or 元素 | ||
179 | $显示宏 "链式调用", 主调用 | ||
180 | |||
181 | 结果a = $链式调用( | ||
182 | _{1, 2, 3, 4, -2, 3} | ||
183 | 链! | ||
184 | 映射 => @ * 2 | ||
185 | 过滤 => @ > 3 | ||
186 | 取值! | ||
187 | ) | ||
188 | |||
189 | $链式调用( | ||
190 | _{1, 2, 3, 4, -2, 3} | ||
191 | 链! | ||
192 | 映射 => @ * 2 | ||
193 | 过滤 => @ > 3 | ||
194 | 每一个 => 打印 @ | ||
195 | ) | ||
196 | |||
197 | 结果 = $链式调用( | ||
198 | 原点.变换.根节点.游戏对象\父节点! | ||
199 | 后代! | ||
200 | 选择启用! | ||
201 | 选择可见! | ||
202 | 标签等于 "fx" | ||
203 | 其中 (x)-> x.名称\结尾为 "(克隆)" | ||
204 | 摧毁! | ||
205 | ) | ||
206 | |||
207 | macro 链式调用B = (...)-> | ||
208 | switch select "#", ... | ||
209 | when 0 then return "" | ||
210 | when 1 then return ... | ||
211 | 参数数组 = {...} | ||
212 | 最后一个 = nil | ||
213 | 声明数组 = for 计数 = 1,#参数数组 | ||
214 | 声明 = if 计数 == #参数数组 | ||
215 | 最后的字符串 = 最后一个 and "#{最后一个}\\" or "" | ||
216 | "\t#{最后的字符串}#{参数数组[计数]}" | ||
217 | else | ||
218 | 最后的字符串 = 最后一个 and "#{最后一个}\\" or "" | ||
219 | "\tlocal _#{计数} = #{最后的字符串}#{参数数组[计数]}" | ||
220 | 最后一个 = "_#{计数}" | ||
221 | 声明 | ||
222 | 结果 = "do | ||
223 | #{table.concat 声明数组, '\n'} | ||
224 | " | ||
225 | $显示宏 "链式调用B", 结果 | ||
226 | |||
227 | $链式调用B( | ||
228 | 原点.变换.根节点.游戏对象\父节点! | ||
229 | 后代! | ||
230 | 选择启用! | ||
231 | 选择可见! | ||
232 | 标签等于 "fx" | ||
233 | 其中 (x)-> x.名称\结尾为 "(克隆)" | ||
234 | 摧毁! | ||
235 | ) | ||
236 | |||
237 | macro 链式调用C = (...)-> | ||
238 | import "yue" as {:to_lua} | ||
239 | 主调用 = nil | ||
240 | 编译配置 = { | ||
241 | implicit_return_root: false | ||
242 | reserve_line_number: false | ||
243 | } | ||
244 | for 参数 in *{...} | ||
245 | 参数转代码 = to_lua(参数,编译配置)\gsub '%s*$','' | ||
246 | if 主调用? | ||
247 | 主调用 = "#{主调用}:#{参数转代码}" | ||
248 | else | ||
249 | 主调用 = 参数转代码 | ||
250 | { | ||
251 | code: $显示宏 "链式调用C", 主调用 | ||
252 | type: "lua" | ||
253 | } | ||
254 | |||
255 | $链式调用C( | ||
256 | 原点.变换.根节点.游戏对象\父节点! | ||
257 | 后代! | ||
258 | 选择启用! | ||
259 | 选择可见! | ||
260 | 标签等于 "fx" | ||
261 | 其中 (x)-> x.名称\结尾为 "(克隆)" | ||
262 | 摧毁! | ||
263 | ) | ||
264 | |||
265 | macro 表 = -> "{'abc', 字段a:123, <call>:=> 998}" | ||
266 | 打印 $表[1], $表.字段a, ($表)!, $表! | ||
267 | |||
268 | 打印 "当前代码行数: #{ $LINE }" | ||
269 | |||
270 | $待办 | ||
271 | |||
272 | macro 跳过 = -> "" | ||
273 | |||
274 | do | ||
275 | 打印 1 | ||
276 | <- $跳过 | ||
277 | 打印 2 | ||
278 | 打印 3 | ||
279 | |||
280 | macro 跳过 = -> "while false do break" | ||
281 | |||
282 | _1 = -> | ||
283 | 打印 1 | ||
284 | <- $跳过 | ||
285 | 打印 2 | ||
286 | 打印 3 | ||
287 | |||
288 | macro 隐式返回宏是允许的 = -> "打印 'abc'\n123" | ||
289 | |||
290 | $隐式返回宏是允许的 | ||
291 | |||
diff --git a/spec/inputs/unicode/macro_export.yue b/spec/inputs/unicode/macro_export.yue new file mode 100644 index 0000000..3c9a942 --- /dev/null +++ b/spec/inputs/unicode/macro_export.yue | |||
@@ -0,0 +1,49 @@ | |||
1 | import "unicode.macro_todo" as $ | ||
2 | import "unicode.macro_todo" as {$, $todo: $待办} | ||
3 | |||
4 | export macro 配置 = (调试 = true)-> | ||
5 | global 调试模式 = 调试 == "true" | ||
6 | global 调试宏 = true | ||
7 | "" | ||
8 | |||
9 | export macro 显示宏 = (名称, 结果)-> | ||
10 | if 调试宏 then " | ||
11 | do | ||
12 | 文本 = #{结果} | ||
13 | print '[宏 ' .. #{名称} .. ']' | ||
14 | print 文本 | ||
15 | 文本 | ||
16 | " | ||
17 | else | ||
18 | 结果 | ||
19 | |||
20 | export macro 断言集 = (条件)-> | ||
21 | if 调试模式 | ||
22 | $显示宏 "断言集", "assert #{条件}" | ||
23 | else | ||
24 | "" | ||
25 | |||
26 | export macro 断言 = (条件)-> | ||
27 | if 调试模式 | ||
28 | $显示宏 "断言", "assert #{条件}" | ||
29 | else | ||
30 | "#{条件}" | ||
31 | |||
32 | export macro 复制 = (源, 目标, ...)-> | ||
33 | $断言集( | ||
34 | 源 != "_源_" and 源 != "_目标_" and 目标 != "_源_" and 目标 != "_目标_" | ||
35 | "复制目标的参数不能是 _源_ or _目标_" | ||
36 | ) | ||
37 | " | ||
38 | do | ||
39 | local _源_, _目标_ | ||
40 | with _目标_ = #{目标} | ||
41 | with _源_ = #{源} | ||
42 | #{table.concat for 字段 in *{...} do " | ||
43 | _目标_.#{字段} = _源_.#{字段} | ||
44 | "}" | ||
45 | |||
46 | $ -> | ||
47 | global 调试模式 = true | ||
48 | global 调试宏 = true | ||
49 | |||
diff --git a/spec/inputs/unicode/macro_todo.yue b/spec/inputs/unicode/macro_todo.yue new file mode 100644 index 0000000..0352a13 --- /dev/null +++ b/spec/inputs/unicode/macro_todo.yue | |||
@@ -0,0 +1,13 @@ | |||
1 | export macro 待办内部实现 = (模块, 行数, 消息)-> | ||
2 | print "待实现#{消息 and ': ' .. 消息 or ''}, 文件为: #{模块}, 代码行数: #{行数}" | ||
3 | { | ||
4 | code: "-- 待实现#{消息 and ': ' .. 消息 or ''}" | ||
5 | type: "lua" | ||
6 | } | ||
7 | |||
8 | export macro 待办 = (消息)-> | ||
9 | if 消息 | ||
10 | "$待办内部实现 $FILE, $LINE, #{消息}" | ||
11 | else | ||
12 | "$待办内部实现 $FILE, $LINE" | ||
13 | |||
diff --git a/spec/inputs/unicode/metatable.yue b/spec/inputs/unicode/metatable.yue new file mode 100644 index 0000000..1b7cb7b --- /dev/null +++ b/spec/inputs/unicode/metatable.yue | |||
@@ -0,0 +1,87 @@ | |||
1 | 变量a = 关闭: true, <close>: => 打印 "离开作用域" | ||
2 | 变量b = <add>: (左, 右)-> 右 - 左 | ||
3 | 变量c = 键1: true, :<add>, 键2: true | ||
4 | 变量w = <[名称]>:123, <"新建">:(值)=> {值} | ||
5 | 变量w.<>["新建"] 变量w.<>[名称] | ||
6 | |||
7 | do close _ = <close>: -> 打印 "离开作用域" | ||
8 | |||
9 | 变量d, 变量e = 变量a.关闭, 变量a.<close> | ||
10 | |||
11 | 变量f = 变量a\<close> 1 | ||
12 | 变量a.<add> = (x, y)-> x + y | ||
13 | |||
14 | do | ||
15 | {:新, :<close>, <close>: 关闭A} = 变量a | ||
16 | 打印 新, close, 关闭A | ||
17 | |||
18 | do | ||
19 | local * | ||
20 | 变量x, \ | ||
21 | {:新, :变量, :<close>, <close>: 关闭A}, \ | ||
22 | :num, :<add>, :<sub> \ | ||
23 | = 123, 变量a.变量b.变量c, 函数! | ||
24 | |||
25 | 变量x.abc, 变量a.变量b.<> = 123, {} | ||
26 | 函数!.<> = mt --, 额外 | ||
27 | 变量a, 变量b.变量c.<>, 变量d, 变量e = 1, mt, "abc", nil | ||
28 | |||
29 | 相同 = 变量a.<>.__index == 变量a.<index> | ||
30 | |||
31 | -- | ||
32 | 变量a.<> = __index: 表 | ||
33 | 变量a.<>.__index = 表 | ||
34 | 变量a.<index> = 表 | ||
35 | -- | ||
36 | |||
37 | mt = 变量a.<> | ||
38 | |||
39 | 表\函数 #列表 | ||
40 | 表\<"函数">列表 | ||
41 | 表\<"函数"> 列表 | ||
42 | |||
43 | import "模块" as :<index>, <newindex>:设置函数 | ||
44 | |||
45 | with 表 | ||
46 | 打印 .<add>, .x\<index> "key" | ||
47 | 变量a = .<index>.<add>\<"新建"> 123 | ||
48 | 变量b = t#.<close>.测试 | ||
49 | 变量c = t #.<close> .测试 | ||
50 | |||
51 | <>:mt = 变量a | ||
52 | 变量a = <>:mt | ||
53 | 变量a = <>:__index:mt | ||
54 | |||
55 | local index | ||
56 | <>:__index:索引 = 变量a | ||
57 | :<index> = 变量a | ||
58 | |||
59 | do <>:{新:构造, :更新} = 变量a | ||
60 | do {新:构造, :更新} = 变量a.<> | ||
61 | |||
62 | 表 = {} | ||
63 | do | ||
64 | 变量f = 表\<"值#{x < y}">(123, ...) | ||
65 | 变量f 表\<'值'> 123, ... | ||
66 | 表\<[[ | ||
67 | 值 | ||
68 | 1 | ||
69 | ]]>(123, ...) | ||
70 | return 表\<["值" .. tostring x > y]>(123, ...) | ||
71 | |||
72 | do | ||
73 | 变量f = 表\<'值'>(123, ...) | ||
74 | 变量f 表\<'值'>(123, ...) | ||
75 | 表\<'值'>(123, ...) | ||
76 | return 表\<'值'> 123, ... | ||
77 | |||
78 | do | ||
79 | 变量f = 表.<["值"]> 123, ... | ||
80 | 变量f = 表.<"值#{x < y}">(123, ...) | ||
81 | 变量f 表.<'值'> 123, ... | ||
82 | 表.<[[ 值 | ||
83 | 1]]>(123, ...) | ||
84 | return 表.<["值" .. tostring x > y]>(123, ...) | ||
85 | |||
86 | nil | ||
87 | |||
diff --git a/spec/inputs/unicode/multiline_chain.yue b/spec/inputs/unicode/multiline_chain.yue new file mode 100644 index 0000000..403f93b --- /dev/null +++ b/spec/inputs/unicode/multiline_chain.yue | |||
@@ -0,0 +1,99 @@ | |||
1 | 变量x = 变量a | ||
2 | .变量b | ||
3 | .变量c | ||
4 | --[[chain item]] .变量d | ||
5 | |||
6 | 变量x | ||
7 | .变量y = 变量a | ||
8 | .变量b | ||
9 | \变量c! | ||
10 | |||
11 | 函数 1, 参数2 | ||
12 | .值 | ||
13 | \获取!, 参数3 | ||
14 | .值 | ||
15 | \获取! | ||
16 | * 1 | ||
17 | * 变量x? | ||
18 | .变量y? | ||
19 | .变量z? | ||
20 | * 3 | ||
21 | |||
22 | 表bb = | ||
23 | 键1: 变量a | ||
24 | \变量b 123 | ||
25 | .变量c! | ||
26 | 键2: | ||
27 | 键w1: 变量a! | ||
28 | .变量b | ||
29 | \变量c! | ||
30 | |||
31 | 表b = 函数1{} | ||
32 | .变量a | ||
33 | |> 函数2? "abc", _ | ||
34 | |||
35 | 函数 = -> [变量a | ||
36 | .变量b | ||
37 | \变量c 123 for {变量a} in *值集合] | ||
38 | |||
39 | 函数1 = -> 变量x, 变量a | ||
40 | \变量b 123 | ||
41 | .变量c "abc" | ||
42 | |||
43 | 结果 = 原始 | ||
44 | .转换.root | ||
45 | .gameObject | ||
46 | \父节点! | ||
47 | \后代节点! | ||
48 | \选择启用! | ||
49 | \选择可见! | ||
50 | \标签相等 "fx" | ||
51 | \筛选 (元素)-> | ||
52 | if 元素\是否目标! | ||
53 | return false | ||
54 | 元素.名称\结束于 "(Clone)" | ||
55 | \销毁! | ||
56 | |||
57 | 原点.变换.根节点.游戏对象 | ||
58 | \父节点!\后代节点! | ||
59 | \选择启用! | ||
60 | \选择可见! | ||
61 | \标签相等 "fx" | ||
62 | \筛选 (元素)-> 元素.名称\结束于 "(Clone)" | ||
63 | \销毁! | ||
64 | |||
65 | with 项目 | ||
66 | .项目字段A = 123 | ||
67 | |||
68 | \调用方法!\连续调用! | ||
69 | |||
70 | \调用方法! | ||
71 | \连续调用! | ||
72 | \连续调用! | ||
73 | |||
74 | switch .项目字段B | ||
75 | \取值! | ||
76 | when "Valid", \获取项目状态! | ||
77 | \项目方法A!\取值! | ||
78 | else | ||
79 | \项目方法B! | ||
80 | \取值! | ||
81 | |||
82 | 变量a = if .项目字段C | ||
83 | .项目字段D | ||
84 | else | ||
85 | .项目字段E | ||
86 | |||
87 | for 变量v in *值集合 | ||
88 | \项目方法C 变量v | ||
89 | |||
90 | for 变量i = 1, 计数器 | ||
91 | \项目方法C 变量i | ||
92 | |||
93 | unless .变量b | ||
94 | .变量c = while .项目字段D | ||
95 | \下一个项目! | ||
96 | \取得! | ||
97 | |||
98 | nil | ||
99 | |||
diff --git a/spec/inputs/unicode/nil_coalescing.yue b/spec/inputs/unicode/nil_coalescing.yue new file mode 100644 index 0000000..104142e --- /dev/null +++ b/spec/inputs/unicode/nil_coalescing.yue | |||
@@ -0,0 +1,48 @@ | |||
1 | do | ||
2 | 变量a = 变量b ?? 变量c | ||
3 | |||
4 | do | ||
5 | :字段a = 变量b ?? 变量c | ||
6 | |||
7 | do | ||
8 | 变量a = 函数! | ||
9 | 变量a ??= false | ||
10 | |||
11 | do | ||
12 | 变量a ??= 函数! | ||
13 | |||
14 | do | ||
15 | local 变量a, 变量b, 变量c, 变量d, 变量e | ||
16 | 变量a = 变量b ?? 变量c ?? 变量d ?? 变量e | ||
17 | |||
18 | do | ||
19 | 变量a = 变量b ?? 变量c ?? 变量d ?? 变量e | ||
20 | |||
21 | do | ||
22 | 函数 变量x ?? "你好" | ||
23 | |||
24 | do | ||
25 | with 函数A! ?? 函数B! | ||
26 | 打印 .字段 | ||
27 | |||
28 | do | ||
29 | 变量a = 1 + 2 + 变量b ?? 变量c + 3 + 4 | ||
30 | |||
31 | do | ||
32 | 变量a = 1 + 2 + (变量b ?? 变量c) + 3 + 4 | ||
33 | |||
34 | do | ||
35 | :字段a, :字段b = 函数! | ||
36 | 变量a or= 1 | ||
37 | 变量b ??= 变量c ?? 2 | ||
38 | |||
39 | do | ||
40 | 变量a = 1 ?? 2 ?? 3 | ||
41 | |||
42 | do | ||
43 | 变量a.字段.字段 ??= 1 | ||
44 | 变量a = 变量b.字段 ?? 变量c.字段 ?? 变量d.字段 | ||
45 | 变量a.字段 ??= 1 | ||
46 | |||
47 | nil | ||
48 | |||
diff --git a/spec/inputs/unicode/operators.yue b/spec/inputs/unicode/operators.yue new file mode 100644 index 0000000..2f1184a --- /dev/null +++ b/spec/inputs/unicode/operators.yue | |||
@@ -0,0 +1,70 @@ | |||
1 | |||
2 | -- binary ops | ||
3 | 数字x = 1 + 3 | ||
4 | |||
5 | 数字y = 1 + | ||
6 | 3 | ||
7 | |||
8 | 数字z = 1 + | ||
9 | 3 + | ||
10 | 4 | ||
11 | |||
12 | -- | ||
13 | |||
14 | 数字k = 变量b and 变量c and | ||
15 | 变量g | ||
16 | |||
17 | 变量h = 东西 and | ||
18 | -> | ||
19 | 打印 "你好 世界" | ||
20 | |||
21 | -- TODO: should fail, indent still set to previous line so it thinks body is | ||
22 | -- indented | ||
23 | 变量i = 东西 or | ||
24 | -> | ||
25 | 打印 "你好 世界" | ||
26 | |||
27 | 变量p = 东西 and | ||
28 | -> | ||
29 | 打印 "你好 世界" | ||
30 | |||
31 | 变量s = 东西 or | ||
32 | -> and 234 | ||
33 | |||
34 | -- | ||
35 | 变量u = { | ||
36 | 颜色: 1 and 2 and | ||
37 | 3 | ||
38 | 4 | ||
39 | 4 | ||
40 | } | ||
41 | |||
42 | 变量v = { | ||
43 | 颜色: 1 and | ||
44 | -> | ||
45 | "yeah" | ||
46 | "great" | ||
47 | 好的: 3 ^ | ||
48 | 2 | ||
49 | } | ||
50 | |||
51 | -- parens | ||
52 | |||
53 | 变量nno = ( | ||
54 | 是的 + 2 ) | ||
55 | |||
56 | 变量nn = ( | ||
57 | 是的 + 2 | ||
58 | ) | ||
59 | |||
60 | 变量n = 你好( | ||
61 | 变量b | ||
62 | ) -> | ||
63 | |||
64 | 你好 变量a, | ||
65 | ( | ||
66 | 是的 + | ||
67 | 2 | ||
68 | ) - | ||
69 | 好的 | ||
70 | |||
diff --git a/spec/inputs/unicode/pipe.yue b/spec/inputs/unicode/pipe.yue new file mode 100644 index 0000000..2cd41ee --- /dev/null +++ b/spec/inputs/unicode/pipe.yue | |||
@@ -0,0 +1,84 @@ | |||
1 | |||
2 | {"abc", 123, 998} |> 每一个 打印 | ||
3 | |||
4 | {1,2,3} | ||
5 | |> 映射 (变量x)-> 变量x * 2 | ||
6 | |> 过滤 (变量x)-> 变量x > 4 | ||
7 | |> 合并 0, (变量a,变量b)-> 变量a + 变量b | ||
8 | |> 打印 | ||
9 | |||
10 | [i |> tostring for i = 0,10] |> table.concat(",") |> 打印 | ||
11 | |||
12 | 变量b = 1 + 2 + (4 |> tostring |> 打印(1) or 123) | ||
13 | |||
14 | if 变量x = 233 |> math.max 998 | ||
15 | 打印 变量x | ||
16 | |||
17 | with 变量b |> 创建? "new" | ||
18 | .value = 123 | ||
19 | 打印 \工作! | ||
20 | |||
21 | 123 |> 函数f? | ||
22 | |||
23 | "abc" |> 函数1? |> 函数2? | ||
24 | |||
25 | 变量c = "abc" |> 函数1? |> 函数2? | ||
26 | |||
27 | 函数f = -> | ||
28 | 参数 |> x.y?\如果 | ||
29 | |||
30 | 998 |> 函数2 "abc", 233 |> 函数0 |> 函数1 | ||
31 | 998 |> 函数0("abc", 233) |> 函数1 |> 函数2 | ||
32 | |||
33 | 1 |> 函数f 2, 3, 4, 5 | ||
34 | 值(2) |> 函数f 1, _, 3, 4, 5 | ||
35 | 数组[3] |> 函数f 1, 2, _, 4, 5 | ||
36 | |||
37 | 变量a = {"1","2","3"} |> table.concat("") |> tonumber |> 函数1(1, 2, 3, _) |> 函数2(1, _, 3) | ||
38 | |||
39 | 读文件("example.txt") |> | ||
40 | 提取(_, 语言, {}) |> | ||
41 | 解析(_, 语言) |> | ||
42 | 发出 |> | ||
43 | 渲染 |> | ||
44 | 打印 | ||
45 | |||
46 | 读文件("example.txt") \ | ||
47 | |> 提取(_, 语言, {}) \ | ||
48 | |> 解析(_, 语言) \ | ||
49 | |> 发出 \ | ||
50 | |> 渲染 \ | ||
51 | |> 打印 | ||
52 | |||
53 | 读文件 "example.txt" | ||
54 | |> 提取 _, 语言, {} | ||
55 | |> 解析 _, 语言 | ||
56 | |> 发出 | ||
57 | |> 渲染 | ||
58 | |> 打印 | ||
59 | |||
60 | 123 |> not 函数! |> 函数f | ||
61 | |||
62 | do | ||
63 | _1 = 列表{"abc","xyz","123"}\映射"#"\值! | ||
64 | |> -函数! | ||
65 | |> abc 123, _, "x" | ||
66 | |||
67 | global _2,_3,_4 = 1,2,3 | ||
68 | |> 函数f | ||
69 | |||
70 | local _5 = 变量v |> 函数1 1 | ||
71 | |> 函数2 2 | ||
72 | |> 函数3 3 | ||
73 | |> 函数4 4 | ||
74 | |||
75 | 变量x = 123 |> 函数a |> 函数b or 456 |> 函数c |> 函数d or 函数a.if\那么("abc") or 函数a?.函数b\函数c?(123) or 变量x\函数y | ||
76 | |||
77 | 变量x1 = 3 * -4 |> 函数f | ||
78 | |||
79 | 变量x2 = 3 * -2 ^ 2 |> 函数f | ||
80 | |||
81 | 变量y = 1 + not # 2 |> (函数a ^ 函数c) |> 函数b(3,_) * 4 ^ -123 |> 函数f |> 函数1 or 123 | ||
82 | |||
83 | nil | ||
84 | |||
diff --git a/spec/inputs/unicode/plus.yue b/spec/inputs/unicode/plus.yue new file mode 100644 index 0000000..b08974f --- /dev/null +++ b/spec/inputs/unicode/plus.yue | |||
@@ -0,0 +1,41 @@ | |||
1 | 变量x\执行 "工作" | ||
2 | |||
3 | 方法 变量a\执行!\结束("好")\如果 "abc", 123 | ||
4 | |||
5 | 结果 = 变量b.函数\执行!\当("好")\如果 "def", 998 | ||
6 | |||
7 | 变量c.重复.如果\然后("xyz")\否则 结果 | ||
8 | |||
9 | 打印 @循环, @@函数 123 | ||
10 | |||
11 | if 颜色 = 消息\匹配 "<%w*>" then 消息 = 消息\替换 "<%->", 颜色 | ||
12 | |||
13 | 消息 = 消息\替换 "<%->", 颜色 if 颜色 = 消息\匹配 "<%w*>" | ||
14 | |||
15 | 数值A = 方法! if 方法 = 获取方法! | ||
16 | |||
17 | local 数值A = 方法! if 方法 = 获取方法! | ||
18 | |||
19 | 数值B = do | ||
20 | 方法 = 获取方法! | ||
21 | 方法?! | ||
22 | |||
23 | global 背包 = | ||
24 | 东西: | ||
25 | 好的: 200 | ||
26 | 他们: -> | ||
27 | 打印 "你好" | ||
28 | 你的脚"小" | ||
29 | 美丽: 头发 | ||
30 | 黄金: 嗯哼 | ||
31 | 为什么: 1000 | ||
32 | |||
33 | 吃: 食物 | ||
34 | 好的: 朋友 | ||
35 | |||
36 | 开始 = | ||
37 | 东西: "冷" | ||
38 | |||
39 | local 洗澡 = | ||
40 | 在: "火" | ||
41 | |||
diff --git a/spec/inputs/unicode/return.yue b/spec/inputs/unicode/return.yue new file mode 100644 index 0000000..3fae635 --- /dev/null +++ b/spec/inputs/unicode/return.yue | |||
@@ -0,0 +1,66 @@ | |||
1 | -- testing `return` propagation | ||
2 | |||
3 | _ = -> _ = 变量x for 变量x in *物品 | ||
4 | _ = -> [变量x for 变量x in *物品] | ||
5 | |||
6 | |||
7 | -- doesn't make sense on purpose | ||
8 | do | ||
9 | for 变量x in *物品 do return 变量x | ||
10 | |||
11 | do | ||
12 | return [变量x for 变量x in *物品] | ||
13 | |||
14 | do | ||
15 | return {变量x,变量y for 变量x,变量y in *物品} | ||
16 | |||
17 | _ = -> | ||
18 | if 变量a | ||
19 | if 变量a | ||
20 | 变量a | ||
21 | else | ||
22 | 变量b | ||
23 | elseif 变量b | ||
24 | if 变量a | ||
25 | 变量a | ||
26 | else | ||
27 | 变量b | ||
28 | else | ||
29 | if 变量a | ||
30 | 变量a | ||
31 | else | ||
32 | 变量b | ||
33 | |||
34 | do | ||
35 | return if 变量a | ||
36 | if 变量a | ||
37 | 变量a | ||
38 | else | ||
39 | 变量b | ||
40 | elseif 变量b | ||
41 | if 变量a | ||
42 | 变量a | ||
43 | else | ||
44 | 变量b | ||
45 | else | ||
46 | if 变量a | ||
47 | 变量a | ||
48 | else | ||
49 | 变量b | ||
50 | |||
51 | do | ||
52 | return | ||
53 | :值 | ||
54 | 物品A: 123 | ||
55 | 物品B: "abc" | ||
56 | |||
57 | do | ||
58 | return | ||
59 | * 1 | ||
60 | * 2 | ||
61 | * ...三 | ||
62 | * 4 | ||
63 | |||
64 | _ = -> 变量a\变量b | ||
65 | do 变量a\变量b | ||
66 | |||
diff --git a/spec/inputs/unicode/string.yue b/spec/inputs/unicode/string.yue new file mode 100644 index 0000000..09851ec --- /dev/null +++ b/spec/inputs/unicode/string.yue | |||
@@ -0,0 +1,74 @@ | |||
1 | |||
2 | 你好 = "你好" | ||
3 | 问候 = "啥事,好吧" | ||
4 | 打印 你好 | ||
5 | |||
6 | 嗯 = '嗯' | ||
7 | |||
8 | 这里, 另一个 = "好的", '世界' | ||
9 | |||
10 | 呀 = "YU'M" | ||
11 | 你 '我说:"嗯"' | ||
12 | |||
13 | 打印 呀, 你 | ||
14 | |||
15 | 另一个 = [[ 你好 世界 ]] | ||
16 | |||
17 | 你好_那里 = [[ | ||
18 | 你好呀 | ||
19 | ]] | ||
20 | |||
21 | 好吧 = [==[ "helo" ]==] | ||
22 | |||
23 | 哈喽 = [===[ | ||
24 | eat noots]===] | ||
25 | |||
26 | 嗯嗯 = [[well trhere]] | ||
27 | |||
28 | 文字 = [[ | ||
29 | |||
30 | nil | ||
31 | Fail to compile | ||
32 | ]] | ||
33 | |||
34 | 文字[ [[abc]]] = [["#{变量i}" for 变量i = 1, 10] for 变量i = 1, 10]] | ||
35 | |||
36 | 哦哦 = "" | ||
37 | |||
38 | 变量x = "\\" | ||
39 | 变量x = "a\\b" | ||
40 | 变量x = "\\\n" | ||
41 | 变量x = "\"" | ||
42 | |||
43 | -- | ||
44 | |||
45 | 变量a = "你好 #{问候} 你好" | ||
46 | 变量b = "#{问候} 你好" | ||
47 | 变量c = "你好 #{5+1}" | ||
48 | 变量d = "#{你好 世界}" | ||
49 | 变量e = "#{1} #{2} #{3}" | ||
50 | |||
51 | 变量f = [[你好 #{世界} 世界]] | ||
52 | 变量g = "\#{你好 世界}" | ||
53 | |||
54 | -- | ||
55 | |||
56 | 变量a = '你好 #{问候} 你好' | ||
57 | 变量b = '#{问候} 你好' | ||
58 | 变量c = '你好 #{问候}' | ||
59 | |||
60 | |||
61 | -- | ||
62 | |||
63 | 变量_ = "你好" | ||
64 | "你好"\格式 1 | ||
65 | "你好"\格式(1,2,3) | ||
66 | "你好"\格式(1,2,3) 1,2,3 | ||
67 | |||
68 | "你好"\世界! | ||
69 | "你好"\格式!.问候 1,2,3 | ||
70 | "你好"\格式 1,2,3 | ||
71 | |||
72 | 某事"你好"\世界! | ||
73 | 某事 "你好"\世界! | ||
74 | |||
diff --git a/spec/inputs/unicode/stub.yue b/spec/inputs/unicode/stub.yue new file mode 100644 index 0000000..05a9191 --- /dev/null +++ b/spec/inputs/unicode/stub.yue | |||
@@ -0,0 +1,18 @@ | |||
1 | |||
2 | |||
3 | 变量x = { | ||
4 | 值: 100 | ||
5 | 你好: => | ||
6 | 打印 @val | ||
7 | } | ||
8 | |||
9 | 函数 = 变量x\值 | ||
10 | 打印 函数! | ||
11 | 打印 变量x\值! | ||
12 | |||
13 | |||
14 | -- ... should be bubbled up anon functions | ||
15 | ((...)-> 变量x = 你好(...)\世界)! | ||
16 | |||
17 | nil | ||
18 | |||
diff --git a/spec/inputs/unicode/switch.yue b/spec/inputs/unicode/switch.yue new file mode 100644 index 0000000..aa8ea74 --- /dev/null +++ b/spec/inputs/unicode/switch.yue | |||
@@ -0,0 +1,161 @@ | |||
1 | switch 值 | ||
2 | when "酷" | ||
3 | 打印 "你好,世界" | ||
4 | |||
5 | switch 值 | ||
6 | when "酷" | ||
7 | 打印 "你好,世界" | ||
8 | else | ||
9 | 打印 "好的,很棒" | ||
10 | |||
11 | switch 值 | ||
12 | when "酷" | ||
13 | 打印 "你好,世界" | ||
14 | when "是的" | ||
15 | 变量_ = [[FFFF]] + [[MMMM]] | ||
16 | when 2323 + 32434 | ||
17 | 打印 "好的" | ||
18 | else | ||
19 | 打印 "好的,很棒" | ||
20 | |||
21 | 输出 = switch 值 | ||
22 | when "酷" then 打印 "你好,世界" | ||
23 | else 打印 "好的,很棒" | ||
24 | |||
25 | 输出 = switch 值 | ||
26 | when "酷" then 变量x | ||
27 | when "哦" then 34340 | ||
28 | else error "这大大地失败了" | ||
29 | |||
30 | with 东西 | ||
31 | switch \值! | ||
32 | when .确定 | ||
33 | 变量_ = "世界" | ||
34 | else | ||
35 | 变量_ = "是的" | ||
36 | |||
37 | 修复 这个 | ||
38 | call_func switch 某物 | ||
39 | when 1 then "是" | ||
40 | else "否" | ||
41 | |||
42 | -- | ||
43 | |||
44 | switch 嗨 | ||
45 | when 你好 or 世界 | ||
46 | 变量_ = 绿色 | ||
47 | |||
48 | -- | ||
49 | |||
50 | switch 嗨 | ||
51 | when "一个", "两个" | ||
52 | 打印 "酷" | ||
53 | when "爸爸" | ||
54 | 变量_ = 否 | ||
55 | |||
56 | switch 嗨 | ||
57 | when 3+1, 你好!, (-> 4)! | ||
58 | 变量_ = 黄色 | ||
59 | else | ||
60 | 打印 "酷" | ||
61 | |||
62 | do | ||
63 | 字典 = { | ||
64 | {} | ||
65 | {1, 2, 3} | ||
66 | 变量a: 变量b: 变量c: 1 | ||
67 | 变量x: 变量y: 变量z: 1 | ||
68 | } | ||
69 | |||
70 | switch 字典 | ||
71 | when { | ||
72 | 第一 | ||
73 | {一个, 两个, 三个} | ||
74 | 变量a: 变量b: :变量c | ||
75 | 变量x: 变量y: :变量z | ||
76 | } | ||
77 | 打印 第一, 一个, 两个, 三个, 变量c, 变量z | ||
78 | |||
79 | do | ||
80 | 物品 = | ||
81 | * 变量x: 100 | ||
82 | 变量y: 200 | ||
83 | * 宽度: 300 | ||
84 | 高度: 400 | ||
85 | * false | ||
86 | |||
87 | for 物 in *物品 | ||
88 | switch 物 | ||
89 | when :变量x, :变量y | ||
90 | 打印 "Vec2 #{变量x}, #{变量y}" | ||
91 | when :宽度, :高度 | ||
92 | 打印 "Size #{宽度}, #{高度}" | ||
93 | when false | ||
94 | 打印 "没有" | ||
95 | when __类: 类 | ||
96 | switch 类 | ||
97 | when 类别A | ||
98 | 打印 "对象 A" | ||
99 | when 类别B | ||
100 | 打印 "对象 B" | ||
101 | when <>: 表 | ||
102 | 打印 "带有元表的表" | ||
103 | else | ||
104 | 打印 "物品不被接受!" | ||
105 | |||
106 | do | ||
107 | 表格 = {} | ||
108 | |||
109 | switch 表格 | ||
110 | when {:变量a = 1, :变量b = 2} | ||
111 | 打印 变量a, 变量b | ||
112 | |||
113 | switch 表格 | ||
114 | when {:变量a, :变量b = 2} | ||
115 | 打印 "部分匹配", 变量a, 变量b | ||
116 | |||
117 | switch 表格 | ||
118 | when {:变量a, :变量b} | ||
119 | 打印 变量a, 变量b | ||
120 | else | ||
121 | 打印 "没有匹配" | ||
122 | |||
123 | do | ||
124 | 表格 = 变量x: "abc" | ||
125 | switch 表格 | ||
126 | when :变量x, :变量y | ||
127 | 打印 "变量x: #{变量x} 和 变量y: #{变量y}" | ||
128 | when :变量x | ||
129 | 打印 "只有 变量x: #{变量x}" | ||
130 | |||
131 | do | ||
132 | 匹配 = switch 表格 | ||
133 | when 1 | ||
134 | "1" | ||
135 | when :变量x | ||
136 | 变量x | ||
137 | when false | ||
138 | "false" | ||
139 | else | ||
140 | nil | ||
141 | |||
142 | do | ||
143 | return switch 表格 | ||
144 | when nil | ||
145 | "无效" | ||
146 | when :变量a, :变量b | ||
147 | "#{变量a + 变量b}" | ||
148 | when 1, 2, 3, 4, 5 | ||
149 | "数字 1 - 5" | ||
150 | when {:匹配任何表格 = "后备"} | ||
151 | 匹配任何表格 | ||
152 | else | ||
153 | "除非它不是一个表格,否则不应到达这里" | ||
154 | |||
155 | do | ||
156 | switch 变量y | ||
157 | when {变量x: <>: 表} | ||
158 | 打印 表 | ||
159 | |||
160 | nil | ||
161 | |||
diff --git a/spec/inputs/unicode/syntax.yue b/spec/inputs/unicode/syntax.yue new file mode 100644 index 0000000..f382688 --- /dev/null +++ b/spec/inputs/unicode/syntax.yue | |||
@@ -0,0 +1,448 @@ | |||
1 | #!/this/is/ignored | ||
2 | |||
3 | 变量a = 1 + 2 * 3 / 6 | ||
4 | |||
5 | 变量a, 一堆, 去, 这里 = 另外, 世界, nil, nil | ||
6 | |||
7 | 函数 参数1, 参数2, 另外, 参数3 | ||
8 | |||
9 | 这里, 我们 = () ->, 是的 | ||
10 | 这个, 不同 = () -> 方法; 是的 | ||
11 | |||
12 | 爸爸() | ||
13 | 爸爸(主) | ||
14 | 你好(一,二)() | ||
15 | (5 + 5)(世界) | ||
16 | |||
17 | 乐趣(变量a)(变量b) | ||
18 | |||
19 | 乐趣(变量a) 变量b | ||
20 | |||
21 | 乐趣(变量a) 变量b, 坏 你好 | ||
22 | |||
23 | 你好 世界 你在这里做什么 | ||
24 | |||
25 | 什么(这个)[3243] 世界, 哎呀 | ||
26 | |||
27 | 毛茸茸[手][是](恶心) 好的 好的[世界] | ||
28 | |||
29 | _ = (得到[某事] + 5)[年] | ||
30 | |||
31 | 变量i,变量x = 200, 300 | ||
32 | |||
33 | 是的 = (1 + 5) * 3 | ||
34 | 是的 = ((1+5)*3)/2 | ||
35 | 是的 = ((1+5)*3)/2 + 变量i % 100 | ||
36 | |||
37 | 哇 = (1+2) * (3+4) * (4+5) | ||
38 | |||
39 | _ = -> | ||
40 | if 某事 | ||
41 | return 1,2,4 | ||
42 | |||
43 | 打印 "你好" | ||
44 | |||
45 | _ = -> | ||
46 | if 你好 | ||
47 | "你好", "世界" | ||
48 | else | ||
49 | 不, 方法 | ||
50 | |||
51 | |||
52 | _ = -> 1,2,34 | ||
53 | |||
54 | return 5 + () -> 4 + 2 | ||
55 | |||
56 | return 5 + (() -> 4) + 2 | ||
57 | |||
58 | 打印 5 + () -> | ||
59 | _ = 34 | ||
60 | 好 球 | ||
61 | |||
62 | 某事 '其他', "是" | ||
63 | |||
64 | 某事'其他' | ||
65 | 某事"其他" | ||
66 | |||
67 | _ = 某事[[嘿]] * 2 | ||
68 | _ = 某事[======[嘿]======] * 2 | ||
69 | _ = 某事[ [======[嘿]======] ] * 2 | ||
70 | |||
71 | _, _ = 某事'其他', 2 | ||
72 | _, _ = 某事"其他", 2 | ||
73 | _, _ = 某事[[其他]], 2 | ||
74 | _, _ = 某事[ [[其他]] ], 2 | ||
75 | |||
76 | 某事 '其他', 2 | ||
77 | 某事 "其他", 2 | ||
78 | 某事 [[其他]], 2 | ||
79 | |||
80 | _ = 这里(我们)"去"[12123] | ||
81 | |||
82 | 分裂"abc xyz 123"\映射"#"\打印全部! | ||
83 | |||
84 | _ = f""[变量a] | ||
85 | _ = f""\变量b! | ||
86 | _ = f"".变量c! | ||
87 | |||
88 | f ""[变量a] | ||
89 | f ""\变量b! | ||
90 | f "".变量c! | ||
91 | |||
92 | 列表{"abc", "xyz", "123"}\映射"#"\打印全部! | ||
93 | |||
94 | _ = f{}[变量a] | ||
95 | _ = f{}\变量b! | ||
96 | _ = f{}.变量c! | ||
97 | |||
98 | 某事 = | ||
99 | 测试: 12323 | ||
100 | 什么: -> 打印 "你好 世界" | ||
101 | |||
102 | 打印 某事.测试 | ||
103 | |||
104 | 天哪 = 你好: "世界" | ||
105 | |||
106 | 氩 = | ||
107 | 数字: 100 | ||
108 | 世界: (自己) -> | ||
109 | 打印 自己.数字 | ||
110 | return { | ||
111 | 某事: -> 打印 "嗨 从某事" | ||
112 | } | ||
113 | 某事: (自己, 字符串) -> | ||
114 | 打印 "字符串是", 字符串 | ||
115 | return 世界: (变量a,变量b) -> 打印 "总和", 变量a + 变量b | ||
116 | |||
117 | 某事.什么() | ||
118 | 氩\世界().某事() | ||
119 | |||
120 | 氩\某事"200".世界(1,2) | ||
121 | |||
122 | 变量x = -434 | ||
123 | |||
124 | 变量x = -你好 世界 一 二 | ||
125 | |||
126 | 嗨 = -"herfef" | ||
127 | |||
128 | 变量x = -[变量x for 变量x in 变量x] | ||
129 | |||
130 | 打印 "你好" if 酷 | ||
131 | 打印 "你好" unless 酷 | ||
132 | 打印 "你好" unless 1212 and 3434 | ||
133 | 打印 "你好" for i=1,10 | ||
134 | |||
135 | 打印 "疯子" | ||
136 | |||
137 | if 你好 then _ = 343 | ||
138 | |||
139 | 打印 "什么" if 酷 | ||
140 | |||
141 | 阅读者\解析_行! until 阅读者\结束! | ||
142 | |||
143 | 阅读者\解析_行! while not 阅读者\结束! | ||
144 | |||
145 | ((...)-> 参数 = {...})! | ||
146 | |||
147 | 变量x = (...) -> | ||
148 | dump {...} | ||
149 | |||
150 | 变量x = not true | ||
151 | |||
152 | 变量y = not(5+5) | ||
153 | |||
154 | 变量y = #"你好" | ||
155 | |||
156 | 变量x = #{#{},#{1},#{1,2}} | ||
157 | |||
158 | _, _ = 你好, 世界 | ||
159 | |||
160 | 某事\你好(什么) 变量a,变量b | ||
161 | 某事\你好 什么 | ||
162 | 某事.你好\世界 变量a,变量b | ||
163 | 某事.你好\世界(1,2,3) 变量a,变量b | ||
164 | |||
165 | 变量x = 1232 | ||
166 | 变量x += 10 + 3 | ||
167 | 变量j -= "你好" | ||
168 | 变量y *= 2 | ||
169 | 变量y /= 100 | ||
170 | 变量y //= 100 | ||
171 | 变量m %= 2 | ||
172 | 你好 ..= "世界" | ||
173 | |||
174 | @@某事 += 10 | ||
175 | @某事 += 10 | ||
176 | |||
177 | 变量a["你好"] += 10 | ||
178 | 变量a["你好#{tostring ff}"] += 10 | ||
179 | 变量a[四].字段x += 10 | ||
180 | |||
181 | 变量a.变量b += 1 | ||
182 | 变量a.变量b[1].变量c[2 + 3] += 1 | ||
183 | with 表 | ||
184 | .字段a.变量c += 1 | ||
185 | |||
186 | 表[] = 10 | ||
187 | 变量a.变量b.变量c[] = 1 | ||
188 | 变量x[] = if 条件v | ||
189 | 1 | ||
190 | else | ||
191 | 2 | ||
192 | with 表 | ||
193 | .变量b.变量c[] = with 向量 | ||
194 | .字段x = 1 | ||
195 | .字段y = 2 | ||
196 | 对象a | ||
197 | .变量b.变量c | ||
198 | .变量d\函数! | ||
199 | .变量g[] = 1 | ||
200 | |||
201 | 表 = {} | ||
202 | 表[] = 1 | ||
203 | 表[] = 2 | ||
204 | 表[] = 3 | ||
205 | |||
206 | 变量x = 0 | ||
207 | _ = (if ntype(变量v) == "函数定义" then 变量x + 1) for 变量v in *值 | ||
208 | |||
209 | 你好 = | ||
210 | 某物: 世界 | ||
211 | 如果: "你好" | ||
212 | 否则: 3434 | ||
213 | 函数: "好的" | ||
214 | 好的: 230203 | ||
215 | |||
216 | 表 = { | ||
217 | 执行: 变量b | ||
218 | 执行 :变量b | ||
219 | } | ||
220 | |||
221 | div 类: "酷" | ||
222 | |||
223 | _ = 5 + 什么 无聊 | ||
224 | 什么 无聊 + 5 | ||
225 | |||
226 | _ = 5 - 什么 无聊 | ||
227 | 什么 无聊 - 5 | ||
228 | |||
229 | 变量x = 你好 - 世界 - 某物 | ||
230 | |||
231 | ((某物 = 与 什么 | ||
232 | \酷 100) -> | ||
233 | 打印 某物)! | ||
234 | |||
235 | if 某物 | ||
236 | _ = 03589 | ||
237 | |||
238 | -- 好的 什么 关于这个 | ||
239 | |||
240 | else | ||
241 | _ = 3434 | ||
242 | |||
243 | if 某物 | ||
244 | _ = 是的 | ||
245 | |||
246 | elseif "嗯嗯嗯" | ||
247 | |||
248 | 打印 "酷" | ||
249 | |||
250 | else | ||
251 | |||
252 | _ = 好的 | ||
253 | |||
254 | -- 测试名字包含关键词 | ||
255 | 变量x = 不是某物 | ||
256 | 变量y = 如果某物 | ||
257 | 变量z = 变量x 与 变量b | ||
258 | 变量z = 变量x 与b | ||
259 | |||
260 | while 10 > 某物( | ||
261 | 某物: "世界" | ||
262 | ) | ||
263 | 打印 "是的" | ||
264 | |||
265 | -- 无界表 | ||
266 | |||
267 | 变量x = | ||
268 | 好的: 确定 | ||
269 | |||
270 | 是的 | ||
271 | 好的: 男人 | ||
272 | 确定: 先生 | ||
273 | |||
274 | 你好 "无逗号" | ||
275 | 是的: 爸爸 | ||
276 | 另一个: 世界 | ||
277 | |||
278 | 你好 "逗号", | ||
279 | 某物: 你好_世界 | ||
280 | 骂人: 你 | ||
281 | |||
282 | -- 创建一个表 | ||
283 | 另一个 你好, 一个, | ||
284 | 二, 三, 四, 是的: 男人 | ||
285 | 好的: 是的 | ||
286 | 好: 好的 | ||
287 | |||
288 | 另一个 你好, 一个, | ||
289 | 二, 三, 四, | ||
290 | 是的: 男人, 好的: 是的 | ||
291 | * 好: 好的, | ||
292 | 好的: 1 | ||
293 | * 好: 好的, | ||
294 | 好的: 2 | ||
295 | |||
296 | 另一个 你好, 一个, 二, 三, 四, | ||
297 | 是的: 男人 | ||
298 | 好的: 是的 | ||
299 | |||
300 | 另一个 你好, 一个, 二, 三, 四, 是的: 男人 | ||
301 | 好的: 是的 | ||
302 | |||
303 | 阿贾克斯 地址, | ||
304 | (数据) -> | ||
305 | 处理 数据, | ||
306 | (错误) -> | ||
307 | 打印 错误 | ||
308 | |||
309 | -- | ||
310 | 变量a += 3 - 5 | ||
311 | 变量a *= 3 + 5 | ||
312 | 变量a *= 3 | ||
313 | 变量a >>= 3 | ||
314 | 变量a <<= 3 | ||
315 | 变量a /= 函数 "酷" | ||
316 | |||
317 | --- | ||
318 | |||
319 | 变量x.然后 = "你好" | ||
320 | 变量x.当.真 = "你好" | ||
321 | 变量x | ||
322 | .当 | ||
323 | .真 = "你好" | ||
324 | |||
325 | -- | ||
326 | |||
327 | 变量x or= "你好" | ||
328 | 变量x and= "你好" | ||
329 | |||
330 | -- | ||
331 | |||
332 | 变量z = 变量a-变量b | ||
333 | 变量z = 变量a -变量b | ||
334 | 变量z = 变量a - 变量b | ||
335 | 变量z = 变量a- 变量b | ||
336 | |||
337 | -- 酷 | ||
338 | |||
339 | 字符串 = --[[ | ||
340 | 这是一个多行注释。 | ||
341 | 没问题。 | ||
342 | ]] 字符串A \ -- 注释 1 | ||
343 | .. 字符串B \ -- 注释 2 | ||
344 | .. 字符串C | ||
345 | |||
346 | 函数 --[[端口]] 3000, --[[ip]] "192.168.1.1" | ||
347 | |||
348 | f = -> | ||
349 | 变量a,变量b, \ | ||
350 | 变量c,变量d, \ | ||
351 | 变量e,变量f | ||
352 | |||
353 | f = -> | ||
354 | 变量a,变量b \ | ||
355 | ,变量c,变量d \ | ||
356 | ,变量e,变量f | ||
357 | |||
358 | with 对象 | ||
359 | 调用( | ||
360 | --[[参数1]] \函数!, | ||
361 | --[[参数2]] 123, | ||
362 | --[[参数3]] "abc" | ||
363 | ) | ||
364 | |||
365 | 调用A( | ||
366 | 调用B( | ||
367 | 调用C 123 | ||
368 | ) | ||
369 | ) | ||
370 | |||
371 | 123 | ||
372 | |> 调用C | ||
373 | |> 调用B | ||
374 | |> 调用A | ||
375 | |||
376 | 变量v = { | ||
377 | 变量a -1 | ||
378 | 变量a( | ||
379 | -1) | ||
380 | 变量a \ | ||
381 | - 1 | ||
382 | 变量a-1 | ||
383 | 变量a - 1 | ||
384 | 变量a - | ||
385 | 1 | ||
386 | 变量a- | ||
387 | 1 | ||
388 | 变量a - --[[123]]1 | ||
389 | |||
390 | 变量a ~1 | ||
391 | 变量a( | ||
392 | ~1) | ||
393 | 变量a \ | ||
394 | ~ 1 | ||
395 | 变量a~1 | ||
396 | 变量a ~ 1 | ||
397 | 变量a ~ | ||
398 | 1 | ||
399 | 变量a~ | ||
400 | 1 | ||
401 | 变量a ~ --[[123]]1 | ||
402 | } | ||
403 | |||
404 | do | ||
405 | 变量a = 1 \ | ||
406 | + 2 \ | ||
407 | * 3 / | ||
408 | 4 | ||
409 | |||
410 | 变量_1 = f1 -1 \ | ||
411 | + 2 \ | ||
412 | + 3 | ||
413 | |||
414 | 变量_2 = f1 - 1 \ | ||
415 | + 2 \ | ||
416 | + 3 | ||
417 | |||
418 | f2 = (变量x)-> 打印 变量x \ | ||
419 | +1 | ||
420 | |||
421 | 变量a = f2! | ||
422 | -1 |> f2 | ||
423 | |||
424 | 变量a = f2! \ | ||
425 | - 1 |> f2 | ||
426 | |||
427 | 变量_1 \ | ||
428 | ,变量_2 \ | ||
429 | ,变量_3 \ | ||
430 | ,变量_4 = 1 \ | ||
431 | ,f 2 \ | ||
432 | ,3 \ | ||
433 | ,f 4, \ | ||
434 | 4 | ||
435 | |||
436 | do | ||
437 | f = ( | ||
438 | 变量a -- 参数a | ||
439 | 变量b -- 参数b | ||
440 | )-> 变量a + 变量b | ||
441 | f( | ||
442 | 变量a -- 值a | ||
443 | 变量b -- 值b | ||
444 | ) | ||
445 | f ! | ||
446 | |||
447 | nil | ||
448 | |||
diff --git a/spec/inputs/unicode/tables.yue b/spec/inputs/unicode/tables.yue new file mode 100644 index 0000000..04ed91d --- /dev/null +++ b/spec/inputs/unicode/tables.yue | |||
@@ -0,0 +1,299 @@ | |||
1 | 背包 = | ||
2 | 东西: | ||
3 | 是的: 200 | ||
4 | 他们: -> | ||
5 | print "你好" | ||
6 | 你的脚"小" | ||
7 | 美丽: 头发变量 | ||
8 | 金: 嗯变量 | ||
9 | 您: 1000 | ||
10 | |||
11 | 吃: goo变量 | ||
12 | 是的: dudd变量 | ||
13 | |||
14 | 开始 = | ||
15 | 东西: "冷" | ||
16 | |||
17 | 浴 = | ||
18 | 开: "火" | ||
19 | |||
20 | 另一个 = | ||
21 | [4]: 232 | ||
22 | ["好食物"]: "是最好的" | ||
23 | |||
24 | fwip变量 = | ||
25 | 东西: 你好"什么", 数字: 2323, | ||
26 | 什么: yo变量 "妈妈", "是的", | ||
27 | 水果: basket变量 | ||
28 | 坚果: day变量 | ||
29 | |||
30 | frick变量 = 你好: "世界" | ||
31 | |||
32 | frack变量, 最好 = 你好: "世界", 米饭: 3434, "什么" | ||
33 | |||
34 | ya变量 = { 1,2,3, 键: 100, 343, "你好", 嗯: 232 } | ||
35 | |||
36 | x变量 = { 1,2, | ||
37 | 4343, 343 ,343 } | ||
38 | |||
39 | g变量, p变量 = { | ||
40 | 1,2, nowy变量: "是", 3,4, | ||
41 | 嘿: 232, 另一个: "天" | ||
42 | }, 234 | ||
43 | |||
44 | annother变量 = { | ||
45 | 1,2,3 | ||
46 | 3,4,5 | ||
47 | 6,7,8 | ||
48 | } | ||
49 | |||
50 | 是的变量 = { | ||
51 | [232]: 3434, "你好" | ||
52 | 冰: "蛋糕" | ||
53 | } | ||
54 | |||
55 | -- 混淆的东西... | ||
56 | whatabout变量 = { | ||
57 | 你好 世界, 另一个变量 | ||
58 | 什么, 关于, 现在 | ||
59 | |||
60 | 你好"世界", 是的变量 | ||
61 | 你好 "世界", 是的变量 | ||
62 | } | ||
63 | |||
64 | x变量 = | ||
65 | -- 是的 | ||
66 | 东西: => "你好" | ||
67 | 酷: -- 嗯 | ||
68 | --so ething | ||
69 | 床: { | ||
70 | 2323,2323 | ||
71 | } | ||
72 | 红: 2343 -- 这里 | ||
73 | -- 什么 | ||
74 | 名字: (node变量) => @value node变量 -- 这里 | ||
75 | -- 评论我 | ||
76 | -- 好的 | ||
77 | |||
78 | x变量 = { :东西, 东西: 东西变量 } | ||
79 | |||
80 | y变量 = { | ||
81 | :你好, :那里, :怎么样, :你 | ||
82 | :事情 | ||
83 | } | ||
84 | |||
85 | 电话我 "你好", :x变量, :y变量, :z变量 | ||
86 | |||
87 | t变量 = { | ||
88 | a变量: 'a' | ||
89 | [b变量]: 'b' | ||
90 | } | ||
91 | |||
92 | xam变量 = { | ||
93 | 你好: 1234 | ||
94 | "你好": 12354 | ||
95 | [[你好变量]]: 12354 | ||
96 | ["你好"]: 12354 | ||
97 | [ [[你好变量]] ]: 12354 | ||
98 | } | ||
99 | |||
100 | kam变量 = | ||
101 | 你好: 12 | ||
102 | 好奶酪: | ||
103 | "嗯" | ||
104 | |||
105 | 是的: | ||
106 | 12 + 232 | ||
107 | |||
108 | 让我们: | ||
109 | keepit 继续: 真的, | ||
110 | 好的: "是的" | ||
111 | |||
112 | 更多: | ||
113 | { | ||
114 | 1, [x变量 for x变量=1,10] | ||
115 | } | ||
116 | |||
117 | [{"一个", "两个"}]: | ||
118 | 一件事情 => | ||
119 | |||
120 | -- 这两者都有令人满意的输出 | ||
121 | keepit 继续: 真的, | ||
122 | 好的: "是的", | ||
123 | workd变量: "好的" | ||
124 | |||
125 | 事情 什么: | ||
126 | "伟大", 没有: | ||
127 | "更多" | ||
128 | 好的: 123 | ||
129 | |||
130 | |||
131 | -- | ||
132 | 事情 什么: | ||
133 | "伟大", 没有: | ||
134 | "更多" | ||
135 | _变量 = 好的: 123 -- 一个匿名表 | ||
136 | |||
137 | |||
138 | -- | ||
139 | |||
140 | k变量 = { "你好": "世界" } | ||
141 | k变量 = { '你好': '世界' } | ||
142 | k变量 = { "你好": '世界', "帽子": "zat变量" } | ||
143 | |||
144 | 请 "你好": "世界" | ||
145 | k变量 = "你好": "世界", "一个": "区域" | ||
146 | |||
147 | f1变量, f2变量, f3变量 = "一个", "两个": three变量, "四" | ||
148 | f1变量, f2变量 = "两个": three变量, "四" | ||
149 | f1变量 = { "一个", "两个": three变量, "四" } | ||
150 | |||
151 | j1变量, j2变量, j3变量, j4变量 = "一个", "两个": three变量, "四": five变量, 6, 7 | ||
152 | |||
153 | 女英雄 = | ||
154 | 名字: "克里斯蒂娜" | ||
155 | 年龄: 18 | ||
156 | 工作: "公主" | ||
157 | 喜欢: | ||
158 | * 名字: "小猫" | ||
159 | img变量: "/image/kittens.png" | ||
160 | * 名字: "花" | ||
161 | img变量: "/image/flower.png" | ||
162 | 物品: | ||
163 | * 名字: "戒指" | ||
164 | 数量: 2 | ||
165 | * 名字: "项链" | ||
166 | 数量: 1 | ||
167 | 状态: | ||
168 | desc变量: "弱" | ||
169 | * 属性: "健康" | ||
170 | 价值: 50 | ||
171 | * 属性: "魔法" | ||
172 | 价值: 100 | ||
173 | |||
174 | 库存 = | ||
175 | 设备: | ||
176 | * "剑" | ||
177 | * "盾" | ||
178 | 物品: | ||
179 | * 名字: "药水" | ||
180 | 计数: 10 | ||
181 | * 名字: "面包" | ||
182 | 计数: 3 | ||
183 | |||
184 | 物品 = | ||
185 | * 函数! | ||
186 | * with 变量tb | ||
187 | .abc = 123 | ||
188 | * {1, 2, 3} | ||
189 | * 函数 {1, 2, 3} | ||
190 | * 函数 | ||
191 | * 1 | ||
192 | * 2 | ||
193 | * 3 | ||
194 | * [变量i for 变量i = 1, 3] | ||
195 | * "#{if 变量a then 变量b}" | ||
196 | |||
197 | 双项 = | ||
198 | * | ||
199 | * "国王" | ||
200 | * "王后" | ||
201 | * | ||
202 | * "英雄" | ||
203 | * "公主" | ||
204 | |||
205 | 物品 = | ||
206 | * | ||
207 | 名称: "戒指" | ||
208 | 数量: 2 | ||
209 | * | ||
210 | 名称: "项链" | ||
211 | 数量: 1 | ||
212 | |||
213 | 菜单 = | ||
214 | * 文本: "保存" | ||
215 | 子菜单: | ||
216 | * 文本: "插槽1:" .. (插槽[1].名称 or "无") | ||
217 | 点击: -> | ||
218 | * 文本: {"插槽2"} | ||
219 | 点击: -> | ||
220 | * 文本: [[插槽3]] | ||
221 | 点击: -> | ||
222 | * 文本: ("插槽4")\名称! | ||
223 | 点击: -> | ||
224 | * 文本: ({{"插槽5"}})[1]\名称! | ||
225 | 点击: -> | ||
226 | [6]: { | ||
227 | 文本: ("插槽6") | ||
228 | 点击: -> | ||
229 | } | ||
230 | |||
231 | 变量tb = {...其他} | ||
232 | |||
233 | tb混合 = { | ||
234 | 1, 2, 3 | ||
235 | ... with 物品 | ||
236 | .x = 1 | ||
237 | \函数! | ||
238 | "a", "b", "c" | ||
239 | ...函数?! | ||
240 | 键: "值" | ||
241 | ... -- 在此处执行Lua表行为 | ||
242 | } | ||
243 | |||
244 | tb混合A = { | ||
245 | ...[变量i for 变量i = 1, 10] | ||
246 | 11 | ||
247 | } | ||
248 | |||
249 | tb混合B = { | ||
250 | ... ... -- 此处仅访问vararg中的第一个项 | ||
251 | ... {...} | ||
252 | ... {......} | ||
253 | 1, 2, 3 | ||
254 | } | ||
255 | |||
256 | const 模板 = { | ||
257 | foo: "你好" | ||
258 | bar: "世界" | ||
259 | baz: "!" | ||
260 | } | ||
261 | |||
262 | const 专门化 = { | ||
263 | ...模板 | ||
264 | bar: "鲍勃" | ||
265 | } | ||
266 | |||
267 | 专门化B = { | ||
268 | 函数: -> | ||
269 | ...模板 | ||
270 | 结束: -> | ||
271 | 如果: true | ||
272 | 否则: false | ||
273 | } | ||
274 | |||
275 | 部分 = | ||
276 | * "肩膀" | ||
277 | * "膝盖" | ||
278 | |||
279 | 歌词 = | ||
280 | * "头" | ||
281 | * ...部分 | ||
282 | * "和" | ||
283 | * "脚趾" | ||
284 | |||
285 | tb块 = | ||
286 | 子菜单: | ||
287 | :值 | ||
288 | * ...物品 | ||
289 | * ... | ||
290 | |||
291 | 函数 | ||
292 | * ...物品 | ||
293 | :值 | ||
294 | * ... | ||
295 | k: 变量v | ||
296 | * ... | ||
297 | |||
298 | nil | ||
299 | |||
diff --git a/spec/inputs/unicode/try_catch.yue b/spec/inputs/unicode/try_catch.yue new file mode 100644 index 0000000..71e03ee --- /dev/null +++ b/spec/inputs/unicode/try_catch.yue | |||
@@ -0,0 +1,60 @@ | |||
1 | try | ||
2 | 函数 1, 2, 3 | ||
3 | catch 错误 | ||
4 | 打印 错误 | ||
5 | |||
6 | try 函数 1, 2, 3 | ||
7 | catch 错误 | ||
8 | 打印 错误 | ||
9 | |||
10 | try | ||
11 | 打印 "正在try" | ||
12 | 函数 1, 2, 3 | ||
13 | |||
14 | do | ||
15 | 成功, 结果 = try | ||
16 | 函数 1, 2, 3 | ||
17 | catch 错误 | ||
18 | 打印 错误 | ||
19 | |||
20 | 成功, 结果 = try 函数 1, 2, 3 | ||
21 | |||
22 | try 表.函数 | ||
23 | try 表.函数! | ||
24 | try 表.函数() | ||
25 | try (表.函数!) | ||
26 | try (表\函数(1, 2, 3)) | ||
27 | |||
28 | try 表.函数 1 | ||
29 | try 表.函数(1) | ||
30 | |||
31 | if (try 函数 1 | ||
32 | catch 错误 | ||
33 | 打印 错误) | ||
34 | 打印 "好的" | ||
35 | |||
36 | if try (函数 1) | ||
37 | catch 错误 | ||
38 | 打印 错误 | ||
39 | 打印 "好的" | ||
40 | |||
41 | do | ||
42 | if 成功, 结果 = try 函数 "abc", 123 | ||
43 | 打印 结果 | ||
44 | |||
45 | 成功, 结果 = try 函数 "abc", 123 | ||
46 | catch 错误 | ||
47 | 打印 错误 | ||
48 | |||
49 | 打印 结果 if 成功, 结果 = try 函数 "abc", 123 | ||
50 | catch 错误 | ||
51 | 打印 错误 | ||
52 | |||
53 | do | ||
54 | try | ||
55 | 函数 1, 2, 3 | ||
56 | |||
57 | try 函数 1, 2, 3 | ||
58 | |||
59 | nil | ||
60 | |||
diff --git a/spec/inputs/unicode/unless_else.yue b/spec/inputs/unicode/unless_else.yue new file mode 100644 index 0000000..73db6ef --- /dev/null +++ b/spec/inputs/unicode/unless_else.yue | |||
@@ -0,0 +1,5 @@ | |||
1 | if 变量a | ||
2 | unless 变量b | ||
3 | 打印 "嗨" | ||
4 | elseif 变量c | ||
5 | 打印 "不嗨" | ||
diff --git a/spec/inputs/unicode/using.yue b/spec/inputs/unicode/using.yue new file mode 100644 index 0000000..c700b47 --- /dev/null +++ b/spec/inputs/unicode/using.yue | |||
@@ -0,0 +1,29 @@ | |||
1 | |||
2 | 你好 = "你好" | ||
3 | 世界 = "世界" | ||
4 | |||
5 | _ = (using nil) -> | ||
6 | 你好 = 3223 | ||
7 | |||
8 | _ = (参数a using nil) -> | ||
9 | 你好 = 3223 | ||
10 | 参数a = 323 | ||
11 | |||
12 | _ = (参数a,参数b,参数c using 参数a,参数b,参数c) -> | ||
13 | 参数a,参数b,参数c = 1,2,3 | ||
14 | 世界 = 12321 | ||
15 | |||
16 | _ = (参数a,参数e,参数f using 参数a,参数b,参数c, 你好) -> | ||
17 | 参数a,参数b,参数c = 1,2,3 | ||
18 | 你好 = 12321 | ||
19 | 世界 = "yeah" | ||
20 | |||
21 | _ = (using nil) -> | ||
22 | 你好 or= 2 | ||
23 | |||
24 | do | ||
25 | 变量a = {} | ||
26 | (using nil) <- _ | ||
27 | {元素x, 元素y} = 变量a | ||
28 | |||
29 | nil | ||
diff --git a/spec/inputs/unicode/vararg.yue b/spec/inputs/unicode/vararg.yue new file mode 100644 index 0000000..5e7f3c4 --- /dev/null +++ b/spec/inputs/unicode/vararg.yue | |||
@@ -0,0 +1,96 @@ | |||
1 | 连接 = (...) -> | ||
2 | 带有 with 变量a | ||
3 | \函数! | ||
4 | 带有 with 变量a | ||
5 | \函数 ... | ||
6 | |||
7 | 列表生成 [项目[i] for i = 1, 10] | ||
8 | 列表生成 [项目[i] ... for i = 1, 10] | ||
9 | 列表生成 [物品 for 物品 in *项目] | ||
10 | 列表生成 [物品 ... for 物品 in *项目] | ||
11 | |||
12 | 类生成 class 变量A | ||
13 | 函数! | ||
14 | 类生成 class 变量A | ||
15 | 函数 ... | ||
16 | |||
17 | 表生成 {键, 值 for 键, 值 in pairs 表} | ||
18 | 表生成 {键, 值 ... for 键, 值 in pairs 表} | ||
19 | 表生成 {物品, true for 物品 in *项目} | ||
20 | 表生成 {物品(...), true for 物品 in *项目} | ||
21 | |||
22 | 做操作 do | ||
23 | 函数! | ||
24 | 做操作 do | ||
25 | 函数 ... | ||
26 | |||
27 | 当操作 while false | ||
28 | 函数! | ||
29 | 当操作 while false | ||
30 | 函数 ... | ||
31 | |||
32 | 如果操作 if false | ||
33 | 函数! | ||
34 | 如果操作 if false | ||
35 | 函数 ... | ||
36 | |||
37 | 除非操作 unless true | ||
38 | 函数! | ||
39 | 除非操作 unless true | ||
40 | 函数 ... | ||
41 | |||
42 | 切换操作 switch 变量x | ||
43 | when "abc" | ||
44 | 函数! | ||
45 | 切换操作 switch 变量x | ||
46 | when "abc" | ||
47 | 函数 ... | ||
48 | |||
49 | 表达式操作 函数?! | ||
50 | 表达式操作 函数? ... | ||
51 | |||
52 | 冒号 f!\函数 | ||
53 | 冒号 f(...)\函数 | ||
54 | |||
55 | _ = -> | ||
56 | 列表 = {1, 2, 3, 4, 5} | ||
57 | 函数名 = (确定) -> | ||
58 | 确定, table.unpack 列表 | ||
59 | 确定, ... = 函数名 true | ||
60 | 打印 确定, ... | ||
61 | |||
62 | 多参数函数 = -> | ||
63 | 10, nil, 20, nil, 30 | ||
64 | |||
65 | ... = 多参数函数! | ||
66 | 打印 select "#", ... | ||
67 | 打印 ... | ||
68 | |||
69 | do | ||
70 | ... = 1, 2 if true | ||
71 | 打印 ... | ||
72 | |||
73 | do | ||
74 | 变量a, ... = 1, 2 unless true | ||
75 | 打印 变量a, select '#', ... | ||
76 | |||
77 | do | ||
78 | ... = switch 变量x when 1 | ||
79 | with 表 | ||
80 | .变量x = 123 | ||
81 | else | ||
82 | 表2 | ||
83 | 打印 ... | ||
84 | |||
85 | do | ||
86 | ... = 1, 2, if 条件 | ||
87 | 3, 4, 5 | ||
88 | 打印 ... | ||
89 | |||
90 | do | ||
91 | 表, ... = | ||
92 | 名字: "abc" | ||
93 | 值: 123 | ||
94 | 打印 ... | ||
95 | nil | ||
96 | |||
diff --git a/spec/inputs/unicode/whitespace.yue b/spec/inputs/unicode/whitespace.yue new file mode 100644 index 0000000..efe55ce --- /dev/null +++ b/spec/inputs/unicode/whitespace.yue | |||
@@ -0,0 +1,133 @@ | |||
1 | _ = { | ||
2 | 1, 2 | ||
3 | } | ||
4 | |||
5 | _ = { 1, 2 | ||
6 | } | ||
7 | |||
8 | _ = { 1, 2 } | ||
9 | |||
10 | _ = {1,2} | ||
11 | |||
12 | _ = { | ||
13 | 1,2 | ||
14 | } | ||
15 | |||
16 | _ = { 事情 1,2, | ||
17 | 4,5,6, | ||
18 | 3,4,5 | ||
19 | } | ||
20 | |||
21 | _ = { | ||
22 | 变量a 1,2,3, | ||
23 | 4,5,6 | ||
24 | 1,2,3 | ||
25 | } | ||
26 | |||
27 | _ = { | ||
28 | 变量b 1,2,3, | ||
29 | 4,5,6 | ||
30 | 1,2,3, | ||
31 | 1,2,3 | ||
32 | } | ||
33 | |||
34 | _ = { 1,2,3 } | ||
35 | |||
36 | _ = { 变量c 1,2,3, | ||
37 | } | ||
38 | |||
39 | 你好 1,2,3,4, | ||
40 | 1,2,3,4,4,5 | ||
41 | |||
42 | 变量x 1, | ||
43 | 2, 3, | ||
44 | 4, 5, 6 | ||
45 | |||
46 | 你好 1,2,3, | ||
47 | 世界 4,5,6, | ||
48 | 5,6,7,8 | ||
49 | |||
50 | 你好 1,2,3, | ||
51 | 世界 4,5,6, | ||
52 | 5,6,7,8, | ||
53 | 9,9 | ||
54 | |||
55 | _ = { | ||
56 | 你好 1,2, | ||
57 | 3,4, | ||
58 | 5, 6 | ||
59 | } | ||
60 | |||
61 | 变量x = { | ||
62 | 你好 1,2,3,4, | ||
63 | 5,6,7 | ||
64 | 1,2,3,4 | ||
65 | } | ||
66 | |||
67 | if 你好 1,2,3, | ||
68 | 世界, | ||
69 | 世界 | ||
70 | 打印 "你好" | ||
71 | |||
72 | if 你好 1,2,3, | ||
73 | 世界, | ||
74 | 世界 | ||
75 | 打印 "你好" | ||
76 | |||
77 | -- | ||
78 | |||
79 | 变量a( | ||
80 | 一个, 两个, 三个 | ||
81 | ) | ||
82 | |||
83 | 变量b( | ||
84 | 一个, | ||
85 | 两个, | ||
86 | 三个 | ||
87 | ) | ||
88 | |||
89 | 变量c(一个, 两个, | ||
90 | 三个, 四个) | ||
91 | |||
92 | -- | ||
93 | |||
94 | v = -> | ||
95 | 变量a, \-- v1 | ||
96 | 变量b, \-- v2 | ||
97 | 变量c -- v3 | ||
98 | |||
99 | v1, v2, \ | ||
100 | v3 = -> | ||
101 | 变量a; \-- 函数结束于v1 | ||
102 | 变量b, \-- v2 | ||
103 | 变量c -- v3 | ||
104 | |||
105 | 变量a, 变量b, \ | ||
106 | 变量c, 变量d, \ | ||
107 | 变量e, 变量f = 1, \ | ||
108 | f2 | ||
109 | :abc; \-- 参数2 | ||
110 | 3, \ | ||
111 | 4, \ | ||
112 | 函数5 abc; \-- 参数5 | ||
113 | 6 | ||
114 | |||
115 | for 变量a, \-- 解构1 | ||
116 | 变量b, \-- 解构2 | ||
117 | --[[解构 3]] 变量c \ | ||
118 | in pairs 对象tb | ||
119 | 打印 变量a, \ | ||
120 | 变量b, \ | ||
121 | 变量c | ||
122 | |||
123 | for i = 1, \-- 初始 | ||
124 | 10, \-- 停止 | ||
125 | -1 -- 步进 | ||
126 | 打印 i | ||
127 | |||
128 | local 变量a,\ | ||
129 | 变量b,\ | ||
130 | 变量c | ||
131 | |||
132 | nil | ||
133 | |||
diff --git a/spec/inputs/unicode/with.yue b/spec/inputs/unicode/with.yue new file mode 100644 index 0000000..ecbfdab --- /dev/null +++ b/spec/inputs/unicode/with.yue | |||
@@ -0,0 +1,144 @@ | |||
1 | do | ||
2 | 变量a = -> | ||
3 | with 东西 | ||
4 | 打印 .你好 | ||
5 | 打印 你好 | ||
6 | 打印 "世界" | ||
7 | |||
8 | do | ||
9 | with 叶子 | ||
10 | .世界! | ||
11 | .世界 1,2,3 | ||
12 | |||
13 | 变量g = .什么.是.这 | ||
14 | |||
15 | .你好 1,2,3 | ||
16 | |||
17 | \你好(1,2).世界 2323 | ||
18 | |||
19 | \你好 "是的", "伙计" | ||
20 | .世界 = 200 | ||
21 | |||
22 | do | ||
23 | 滋滋滋 = with 东西 | ||
24 | .设置状态 "你好 世界" | ||
25 | |||
26 | do | ||
27 | 变量x = 5 + with 某事! | ||
28 | \写 "你好 世界" | ||
29 | |||
30 | do | ||
31 | 变量x = { | ||
32 | 你好: with 好的 | ||
33 | \确定! | ||
34 | } | ||
35 | |||
36 | do | ||
37 | with 东西 | ||
38 | _ = \属性"某物".你好 | ||
39 | .属性\发送(一个) | ||
40 | .属性\发送 一个 | ||
41 | |||
42 | -- | ||
43 | |||
44 | do | ||
45 | with 变量a | ||
46 | 打印 .世界 | ||
47 | |||
48 | 模块 = with _模块 = {} | ||
49 | .事物 = "你好" | ||
50 | |||
51 | with 变量a, 变量b = 东西, 布 | ||
52 | 打印 .世界 | ||
53 | |||
54 | 变量x = with 变量a, 变量b = 1, 2 | ||
55 | 打印 变量a + 变量b | ||
56 | |||
57 | 打印 with 变量a, 变量b = 1, 2 | ||
58 | 打印 变量a + 变量b | ||
59 | |||
60 | p = with 你好!.字段x, 世界!.字段y = 1, 2 | ||
61 | 打印 变量a + 变量b | ||
62 | |||
63 | -- | ||
64 | |||
65 | do | ||
66 | 变量x = "你好" | ||
67 | with 变量x | ||
68 | 变量x\大写! | ||
69 | |||
70 | do | ||
71 | with 变量k = "乔" | ||
72 | 打印 \大写! | ||
73 | |||
74 | do | ||
75 | with 变量a,变量b,变量c = "", "", "" | ||
76 | 打印 \大写! | ||
77 | |||
78 | do | ||
79 | 变量a = "床铺" | ||
80 | with 变量a,变量b,变量c = "", "", "" | ||
81 | 打印 \大写! | ||
82 | |||
83 | do | ||
84 | with 变量j | ||
85 | 打印 \大写! | ||
86 | |||
87 | do | ||
88 | with 变量k.变量j = "乔" | ||
89 | 打印 \大写! | ||
90 | |||
91 | do | ||
92 | with 变量a | ||
93 | 打印 .b | ||
94 | with .c | ||
95 | 打印 .d | ||
96 | |||
97 | do | ||
98 | with 变量a | ||
99 | with .b = 2 | ||
100 | 打印 .c | ||
101 | |||
102 | do | ||
103 | _ = -> | ||
104 | with 嗨 | ||
105 | return .a, .b | ||
106 | |||
107 | do | ||
108 | with 表格 | ||
109 | .x = 项目 | ||
110 | .字段 | ||
111 | \函数 123 | ||
112 | |||
113 | do | ||
114 | with 爸爸 | ||
115 | .如果 "是的" | ||
116 | 变量y = .结束.函数 | ||
117 | |||
118 | do | ||
119 | with 表格 | ||
120 | [1] = [2]?\函数! | ||
121 | ["%a-b-c%"] = 123 | ||
122 | [ [[x y z]]] = [变量] | ||
123 | 打印 [ [3]] | ||
124 | with [4] | ||
125 | [1] = 1 | ||
126 | [] = "abc" | ||
127 | [] = | ||
128 | 类型: "你好" | ||
129 | * 名字: "xyz" | ||
130 | 值: 998 | ||
131 | |||
132 | do | ||
133 | global 掩码 | ||
134 | with? 掩码 = 实心矩形 宽: w, 高: h, 颜色: 0x66000000 | ||
135 | .触摸启用 = true | ||
136 | .吞噬触摸 = true | ||
137 | |||
138 | do | ||
139 | with? 掩码 = 实心矩形 宽: w, 高: h, 颜色: 0x66000000 | ||
140 | .触摸启用 = true | ||
141 | .吞噬触摸 = true | ||
142 | |||
143 | nil | ||
144 | |||
diff --git a/spec/outputs/plus.lua b/spec/outputs/plus.lua index 749e830..bd89bfe 100644 --- a/spec/outputs/plus.lua +++ b/spec/outputs/plus.lua | |||
@@ -1,16 +1,18 @@ | |||
1 | x["do"](x, "work") | 1 | local _call_0 = x |
2 | _call_0["do"](_call_0, "work") | ||
2 | func((function() | 3 | func((function() |
3 | local _call_0 = a["do"](a) | 4 | local _call_1 = a |
4 | local _call_1 = _call_0["end"](_call_0, "OK") | 5 | local _call_2 = _call_1["do"](_call_1) |
5 | return _call_1["if"](_call_1, "abc", 123) | 6 | local _call_3 = _call_2["end"](_call_2, "OK") |
7 | return _call_3["if"](_call_3, "abc", 123) | ||
6 | end)()) | 8 | end)()) |
7 | local _call_0 = b["function"] | 9 | local _call_1 = b["function"] |
8 | local _call_1 = _call_0["do"](_call_0) | 10 | local _call_2 = _call_1["do"](_call_1) |
9 | local _call_2 = _call_1["while"](_call_1, "OK") | 11 | local _call_3 = _call_2["while"](_call_2, "OK") |
10 | local res = _call_2["if"](_call_2, "def", 998) | 12 | local res = _call_3["if"](_call_3, "def", 998) |
11 | local _call_3 = c["repeat"]["if"] | 13 | local _call_4 = c["repeat"]["if"] |
12 | local _call_4 = _call_3["then"](_call_3, "xyz") | 14 | local _call_5 = _call_4["then"](_call_4, "xyz") |
13 | _call_4["else"](_call_4, res) | 15 | _call_5["else"](_call_5, res) |
14 | print(self["for"], self.__class["function"](self.__class, 123)) | 16 | print(self["for"], self.__class["function"](self.__class, 123)) |
15 | do | 17 | do |
16 | local fcolor = message:match("<%w*>") | 18 | local fcolor = message:match("<%w*>") |
diff --git a/spec/outputs/unicode/ambiguous.lua b/spec/outputs/unicode/ambiguous.lua new file mode 100644 index 0000000..3783026 --- /dev/null +++ b/spec/outputs/unicode/ambiguous.lua | |||
@@ -0,0 +1,114 @@ | |||
1 | local _u7ed1_u5b9a = _u6293_u53d6["绑定"]; | ||
2 | (_u7ed1_u5b9a(_u58f0_u660e))({ | ||
3 | ["颜色"] = "Red" | ||
4 | }) | ||
5 | local _u53d8_u91cfa = 'b' | ||
6 | local _u53d8_u91cfc = _u53d8_u91cfd; | ||
7 | (_u53d8_u91cfa(_u53d8_u91cfb))(_u53d8_u91cfc(_u53d8_u91cfd)) | ||
8 | _u53d8_u91cfc = _u53d8_u91cfd["变量c"]; | ||
9 | (_u53d8_u91cfa(_u53d8_u91cfb))(_u53d8_u91cfc(_u53d8_u91cfd)); | ||
10 | (_u53d8_u91cfc(_u53d8_u91cfd))(_u53d8_u91cfa(_u53d8_u91cfb)) | ||
11 | local _u53d8_u91cfb | ||
12 | _u53d8_u91cfa, _u53d8_u91cfb = _u53d8_u91cfc, _u53d8_u91cfd; | ||
13 | (_u53d8_u91cfd(_u53d8_u91cfa))(_u53d8_u91cfc) | ||
14 | for _u8ba1_u6570 = 1, 10 do | ||
15 | _u53d8_u91cfa = function() end | ||
16 | (_u6253_u5370)(1) | ||
17 | _u53d8_u91cfa = _u53d8_u91cff; | ||
18 | (_u6253_u5370)(2) | ||
19 | if _u6761_u4ef6 then | ||
20 | (_u6253_u5370)(3) | ||
21 | end | ||
22 | ::_u8df3_u8f6c_u4f4d_u7f6e::; | ||
23 | (_u6253_u5370)(4) | ||
24 | goto _u8df3_u8f6c_u4f4d_u7f6e; | ||
25 | (_u6253_u5370)(5) | ||
26 | end | ||
27 | do | ||
28 | _u6253_u5370(); | ||
29 | (a_u53d8_u91cf)(b_u53d8_u91cf(1)) | ||
30 | _u6253_u5370(); | ||
31 | (fn)(function() end) | ||
32 | end | ||
33 | do | ||
34 | _u6253_u5370() | ||
35 | _u5f02_u6b65_u51fd_u6570(function() | ||
36 | _u6253_u5370(); | ||
37 | --[[a comment to insert]] | ||
38 | (haha)() | ||
39 | return nil | ||
40 | end) | ||
41 | end | ||
42 | do | ||
43 | _u6253_u5370(123) | ||
44 | end | ||
45 | do | ||
46 | _u51fd_u6570f({ | ||
47 | ["v变量"] = v_u53d8_u91cf | ||
48 | }) | ||
49 | local _u6570_u7ec4 | ||
50 | do | ||
51 | local _accum_0 = { } | ||
52 | local _len_0 = 1 | ||
53 | while _u6761_u4ef6f do | ||
54 | _accum_0[_len_0] = { | ||
55 | ["v变量"] = v_u53d8_u91cf | ||
56 | } | ||
57 | _len_0 = _len_0 + 1 | ||
58 | end | ||
59 | _u6570_u7ec4 = _accum_0 | ||
60 | end | ||
61 | repeat | ||
62 | _u6253_u5370(_u53d8_u91cfv) | ||
63 | until _u6761_u4ef6f({ | ||
64 | ["变量v"] = _u53d8_u91cfv | ||
65 | }) | ||
66 | do | ||
67 | local _with_0 = _u6761_u4ef6f | ||
68 | local _u53d8_u91cfv = _u6570_u7ec4["变量v"] | ||
69 | _with_0["字段x"] = 1 | ||
70 | end | ||
71 | local _u53d8_u91cfx | ||
72 | if _u6761_u4ef6f then | ||
73 | _u53d8_u91cfx = { | ||
74 | ["字段v"] = _u5b57_u6bb5v | ||
75 | } | ||
76 | end | ||
77 | do | ||
78 | local _exp_0 = _u6761_u4ef6f({ | ||
79 | ["字段v"] = _u5b57_u6bb5v | ||
80 | }) | ||
81 | if _u6761_u4ef6f == _exp_0 then | ||
82 | _u53d8_u91cfx = { | ||
83 | ["字段v"] = _u5b57_u6bb5v | ||
84 | } | ||
85 | end | ||
86 | end | ||
87 | local _u6570_u5b57_u6570_u7ec4 | ||
88 | do | ||
89 | local _accum_0 = { } | ||
90 | local _len_0 = 1 | ||
91 | for _u6570_u5b57 = 1, _u957f_u5ea6 do | ||
92 | _accum_0[_len_0] = { | ||
93 | ["数字"] = _u6570_u5b57 | ||
94 | } | ||
95 | _len_0 = _len_0 + 1 | ||
96 | end | ||
97 | _u6570_u5b57_u6570_u7ec4 = _accum_0 | ||
98 | end | ||
99 | local _u5bf9_u8c61_u6570_u7ec4 | ||
100 | do | ||
101 | local _accum_0 = { } | ||
102 | local _len_0 = 1 | ||
103 | local _list_0 = _u7269_u4ef6_u6570_u7ec4 | ||
104 | for _index_0 = 1, #_list_0 do | ||
105 | local _u7269_u4ef6 = _list_0[_index_0] | ||
106 | _accum_0[_len_0] = { | ||
107 | ["名称"] = _u7269_u4ef6 | ||
108 | } | ||
109 | _len_0 = _len_0 + 1 | ||
110 | end | ||
111 | _u5bf9_u8c61_u6570_u7ec4 = _accum_0 | ||
112 | end | ||
113 | end | ||
114 | return nil | ||
diff --git a/spec/outputs/unicode/assign.lua b/spec/outputs/unicode/assign.lua new file mode 100644 index 0000000..b530093 --- /dev/null +++ b/spec/outputs/unicode/assign.lua | |||
@@ -0,0 +1,171 @@ | |||
1 | local __u65e0_u6548_u53d8_u91cf | ||
2 | __u65e0_u6548_u53d8_u91cf = function() | ||
3 | local joop_u53d8_u91cf = 2302 | ||
4 | return function(_u597d) | ||
5 | local _u53d8_u91cfd = 100 | ||
6 | _u597d = 1021 | ||
7 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc | ||
8 | _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd = 1, 2, 3, 4 | ||
9 | local _u4f60_u597d | ||
10 | _u4f60_u597d[232], (5 + 5)[121], _u4f60_u597d, _u53d8_u91cfx[99] = 100, 200, 300, 400 | ||
11 | joop_u53d8_u91cf = 12 | ||
12 | end | ||
13 | end | ||
14 | local joop_u53d8_u91cf = 2345 | ||
15 | local _u53d8_u91cfa, _u53d8_u91cfb | ||
16 | if _u4f60_u597d then | ||
17 | _u53d8_u91cfa, _u53d8_u91cfb = "你好", nil | ||
18 | else | ||
19 | _u53d8_u91cfa, _u53d8_u91cfb = "没啥", "✌️" | ||
20 | end | ||
21 | if _u4f60_u597d then | ||
22 | if _u270c_ufe0f then | ||
23 | _u53d8_u91cfa, _u53d8_u91cfb = "一", "二" | ||
24 | else | ||
25 | _u53d8_u91cfa, _u53d8_u91cfb = "mmhh", nil | ||
26 | end | ||
27 | else | ||
28 | _u6253_u5370("其它东西") | ||
29 | _u53d8_u91cfa, _u53d8_u91cfb = "没啥事", "✌️" | ||
30 | end | ||
31 | local _u53d8_u91cfc, _u53d8_u91cfd | ||
32 | if true then | ||
33 | _u53d8_u91cfc, _u53d8_u91cfd = 1, 2 | ||
34 | end | ||
35 | local _u53d8_u91cfx | ||
36 | do | ||
37 | local _u51fd_u6570 = _u83b7_u53d6_u5904_u7406_u51fd_u6570() | ||
38 | if _u51fd_u6570 then | ||
39 | do | ||
40 | _u51fd_u6570() | ||
41 | _u53d8_u91cfx = 123 | ||
42 | end | ||
43 | end | ||
44 | end | ||
45 | return __u65e0_u6548_u53d8_u91cf(function() | ||
46 | setmetatable(a_u53d8_u91cf, (function() | ||
47 | _u6253_u5370(123) | ||
48 | return { } | ||
49 | end)()) | ||
50 | do | ||
51 | local _u5143_u7d20a, _u5143_u7d20b | ||
52 | do | ||
53 | local _exp_0 = _u5bf9_u8c61c | ||
54 | if "a" == _exp_0 then | ||
55 | do | ||
56 | local _obj_0 = _u5b57_u5178 | ||
57 | _u5143_u7d20a, _u5143_u7d20b = _obj_0[1], _obj_0[2] | ||
58 | end | ||
59 | elseif "b" == _exp_0 then | ||
60 | do | ||
61 | local _obj_0 = _u51fd_u6570() | ||
62 | _u5143_u7d20a, _u5143_u7d20b = _obj_0[1], _obj_0[2] | ||
63 | end | ||
64 | end | ||
65 | end | ||
66 | end | ||
67 | do | ||
68 | local _obj_0 = a_u6570_u7ec4 | ||
69 | if _u6761_u4ef6x then | ||
70 | _obj_0[#_obj_0 + 1] = 1 | ||
71 | else | ||
72 | _obj_0[#_obj_0 + 1] = 2 | ||
73 | end | ||
74 | end | ||
75 | do | ||
76 | local _u53d8_u91cfa | ||
77 | if x_u6761_u4ef6 then | ||
78 | do | ||
79 | local _exp_0 = _u5bf9_u8c61y | ||
80 | if 1 == _exp_0 then | ||
81 | do | ||
82 | local _obj_0, _obj_1 = _u51fd_u6570() | ||
83 | _u53d8_u91cfb[#_u53d8_u91cfb + 1] = _obj_1 | ||
84 | _u53d8_u91cfa = _obj_0 | ||
85 | end | ||
86 | end | ||
87 | end | ||
88 | end | ||
89 | end | ||
90 | do | ||
91 | local _u53d8_u91cfa | ||
92 | local _u5143_u7d20b | ||
93 | if x_u6761_u4ef6 then | ||
94 | do | ||
95 | local _obj_0, _obj_1 = _u51fd_u6570() | ||
96 | _u53d8_u91cfa = _obj_0 | ||
97 | _u5143_u7d20b = _obj_1[1] | ||
98 | end | ||
99 | else | ||
100 | _u53d8_u91cfa = 123 | ||
101 | _u5143_u7d20b = _u8868[1] | ||
102 | end | ||
103 | end | ||
104 | do | ||
105 | local _u53d8_u91cfa, _u5bf9_u8c61c | ||
106 | if _u6761_u4ef6x then | ||
107 | do | ||
108 | local _exp_0 = _u5bf9_u8c61y | ||
109 | if 1 == _exp_0 then | ||
110 | do | ||
111 | local _obj_0, _obj_1, _obj_2, _obj_3 = _u51fd_u6570() | ||
112 | do | ||
113 | local _obj_4 = _u6570_u7ec4b | ||
114 | _obj_4[#_obj_4 + 1] = _obj_1 | ||
115 | end | ||
116 | _u53d8_u91cfa, _u5bf9_u8c61c, getmetatable(_u5bf9_u8c61d).__add = _obj_0, _obj_2, _obj_3 | ||
117 | end | ||
118 | end | ||
119 | end | ||
120 | elseif _u6761_u4ef6x2 then | ||
121 | if _u6761_u4ef6y2 then | ||
122 | do | ||
123 | local _obj_0, _obj_1, _obj_2, _obj_3 = _u51fd_u65701() | ||
124 | do | ||
125 | local _obj_4 = _u6570_u7ec4b | ||
126 | _obj_4[#_obj_4 + 1] = _obj_1 | ||
127 | end | ||
128 | _u53d8_u91cfa, _u5bf9_u8c61c, getmetatable(_u5bf9_u8c61d).__add = _obj_0, _obj_2, _obj_3 | ||
129 | end | ||
130 | end | ||
131 | else | ||
132 | _u6253_u5370("hello") | ||
133 | do | ||
134 | _u6253_u5370(123) | ||
135 | do | ||
136 | local _obj_0, _obj_1, _obj_2 = _u51fd_u65702() | ||
137 | do | ||
138 | local _obj_3 = _u6570_u7ec4b | ||
139 | _obj_3[#_obj_3 + 1] = _obj_0 | ||
140 | end | ||
141 | _u53d8_u91cfa, _u5bf9_u8c61c, getmetatable(_u5bf9_u8c61d).__add = 1, _obj_1, _obj_2 | ||
142 | end | ||
143 | end | ||
144 | end | ||
145 | end | ||
146 | do | ||
147 | local _u53d8_u91cfa = 0 | ||
148 | local _u53d8_u91cfb = 0 | ||
149 | local _u53d8_u91cfc = 0 | ||
150 | local _u53d8_u91cfd = 0 | ||
151 | end | ||
152 | do | ||
153 | local a_u53d8_u91cf = _u51fd_u6570() | ||
154 | local b_u53d8_u91cf = a_u53d8_u91cf | ||
155 | local c_u53d8_u91cf = a_u53d8_u91cf | ||
156 | local d_u53d8_u91cf = a_u53d8_u91cf | ||
157 | end | ||
158 | do | ||
159 | local _u53d8_u91cfe = _u6570_u7ec4_u5bf9_u8c61 | ||
160 | local a_u5143_u7d20 = _u53d8_u91cfe[1] | ||
161 | local _u5b57_u6bb5b = _u53d8_u91cfe["字段b"] | ||
162 | _u5bf9_u8c61c["字段d"] = _u53d8_u91cfe | ||
163 | end | ||
164 | do | ||
165 | local _u503c = 123 | ||
166 | local _u53d8_u91cfa = _u503c | ||
167 | local _u53d8_u91cfb = _u503c | ||
168 | local _u53d8_u91cfc = _u503c | ||
169 | end | ||
170 | return nil | ||
171 | end) | ||
diff --git a/spec/outputs/unicode/attrib.lua b/spec/outputs/unicode/attrib.lua new file mode 100644 index 0000000..0f60451 --- /dev/null +++ b/spec/outputs/unicode/attrib.lua | |||
@@ -0,0 +1,122 @@ | |||
1 | local _u5e38_u91cfa <const>, _u5e38_u91cfb <const>, _u5e38_u91cfc <const>, _u5e38_u91cfd <const> = 1, 2, 3, 4 | ||
2 | do | ||
3 | local _u5173_u95ed_u53d8_u91cfa, _u5173_u95ed_u53d8_u91cfb = setmetatable({ }, { | ||
4 | __close = function(self) | ||
5 | return _u6253_u5370("已关闭") | ||
6 | end | ||
7 | }) | ||
8 | local _close_0 <close> = _u5173_u95ed_u53d8_u91cfa | ||
9 | local _close_1 <close> = _u5173_u95ed_u53d8_u91cfb | ||
10 | local _u53d8_u91cfc <const>, _u5e38_u91cfd <const> = 123, 'abc' | ||
11 | close(_u5e38_u91cfa, _u5e38_u91cfb) | ||
12 | const(_u5e38_u91cfc, _u5e38_u91cfd) | ||
13 | end | ||
14 | do | ||
15 | local _u5e38_u91cfa <const> = _u51fd_u6570() | ||
16 | local _u5143_u7d20b, _u5143_u7d20c, _u5143_u7d20d | ||
17 | do | ||
18 | local _obj_0, _obj_1 = _u51fd_u65701() | ||
19 | _u5143_u7d20b, _u5143_u7d20c = _obj_0[1], _obj_0[2] | ||
20 | _u5143_u7d20d = _obj_1[1] | ||
21 | end | ||
22 | end | ||
23 | do | ||
24 | local _u5e38_u91cfa, _u5143_u7d20b, _u5143_u7d20c, _u5143_u7d20d | ||
25 | do | ||
26 | local _obj_0, _obj_1, _obj_2 = _u51fd_u6570() | ||
27 | _u5e38_u91cfa = _obj_0 | ||
28 | _u5143_u7d20b, _u5143_u7d20c = _obj_1[1], _obj_1[2] | ||
29 | _u5143_u7d20d = _obj_2[1] | ||
30 | end | ||
31 | end | ||
32 | do | ||
33 | local _u5173_u95ed_u53d8_u91cfv <close> = (function() | ||
34 | if _u6807_u8bb0_u4e3a_u771f then | ||
35 | return _u51fd_u6570_u8c03_u7528() | ||
36 | else | ||
37 | return setmetatable({ }, { | ||
38 | __close = function(self) end | ||
39 | }) | ||
40 | end | ||
41 | end)() | ||
42 | local _u5173_u95ed_u53d8_u91cff <close> = (function() | ||
43 | local _with_0 = io.open("文件.txt") | ||
44 | _with_0:write("你好") | ||
45 | return _with_0 | ||
46 | end)() | ||
47 | end | ||
48 | do | ||
49 | local _u5e38_u91cfa <const> = (function() | ||
50 | if true then | ||
51 | return 1 | ||
52 | end | ||
53 | end)() | ||
54 | local _u5173_u95ed_u53d8_u91cfb <close> = (function() | ||
55 | if not false then | ||
56 | if _u6761_u4ef6x then | ||
57 | return 1 | ||
58 | end | ||
59 | end | ||
60 | end)() | ||
61 | local _u5e38_u91cfc <const> = (function() | ||
62 | if true then | ||
63 | local _exp_0 = _u6761_u4ef6x | ||
64 | if "abc" == _exp_0 then | ||
65 | return 998 | ||
66 | end | ||
67 | end | ||
68 | end)() | ||
69 | local _u5173_u95ed_u53d8_u91cfd <close> = (function() | ||
70 | if (function() | ||
71 | local _exp_0 = _u6761_u4ef6a | ||
72 | if _exp_0 ~= nil then | ||
73 | return _exp_0 | ||
74 | else | ||
75 | return _u6761_u4ef6b | ||
76 | end | ||
77 | end)() then | ||
78 | return { | ||
79 | ["数值"] = _u6570_u503c | ||
80 | } | ||
81 | end | ||
82 | end)() | ||
83 | end | ||
84 | do | ||
85 | local __u65e0_u6548_u53d8_u91cf <close> = (function() | ||
86 | local _with_0 = io.open("文件.txt") | ||
87 | _with_0:write("你好") | ||
88 | return _with_0 | ||
89 | end)() | ||
90 | local __u65e0_u6548_u53d8_u91cf <close> = setmetatable({ }, { | ||
91 | __close = function() | ||
92 | return _u6253_u5370("第二") | ||
93 | end | ||
94 | }) | ||
95 | local __u65e0_u6548_u53d8_u91cf <close> = setmetatable({ }, { | ||
96 | __close = function() | ||
97 | return _u6253_u5370("第一") | ||
98 | end | ||
99 | }) | ||
100 | end | ||
101 | local __u5ef6_u8fdf_u5bf9_u8c61_u6570_u7ec4 = setmetatable({ }, { | ||
102 | __close = function(self) | ||
103 | self[#self]() | ||
104 | self[#self] = nil | ||
105 | end | ||
106 | }) | ||
107 | local _u5ef6_u8fdf | ||
108 | _u5ef6_u8fdf = function(_u9879_u76ee) | ||
109 | __u5ef6_u8fdf_u5bf9_u8c61_u6570_u7ec4[#__u5ef6_u8fdf_u5bf9_u8c61_u6570_u7ec4 + 1] = _u9879_u76ee | ||
110 | return __u5ef6_u8fdf_u5bf9_u8c61_u6570_u7ec4 | ||
111 | end | ||
112 | do | ||
113 | local __u65e0_u6548_u53d8_u91cf <close> = _u5ef6_u8fdf(function() | ||
114 | return _u6253_u5370(3) | ||
115 | end) | ||
116 | local __u65e0_u6548_u53d8_u91cf <close> = _u5ef6_u8fdf(function() | ||
117 | return _u6253_u5370(2) | ||
118 | end) | ||
119 | local __u65e0_u6548_u53d8_u91cf <close> = _u5ef6_u8fdf(function() | ||
120 | return _u6253_u5370(1) | ||
121 | end) | ||
122 | end | ||
diff --git a/spec/outputs/unicode/backcall.lua b/spec/outputs/unicode/backcall.lua new file mode 100644 index 0000000..91dfdff --- /dev/null +++ b/spec/outputs/unicode/backcall.lua | |||
@@ -0,0 +1,151 @@ | |||
1 | do | ||
2 | _u6620_u5c04({ | ||
3 | 1, | ||
4 | 2, | ||
5 | 3 | ||
6 | }, function(_u9879_u76ee) | ||
7 | return _u9879_u76ee * 2 | ||
8 | end) | ||
9 | end | ||
10 | do | ||
11 | _u6620_u5c04(function(_u9879_u76ee) | ||
12 | return _u9879_u76ee * 2 | ||
13 | end, { | ||
14 | 1, | ||
15 | 2, | ||
16 | 3 | ||
17 | }) | ||
18 | end | ||
19 | do | ||
20 | _u8fc7_u6ee4(function(_u9879_u76ee) | ||
21 | return _u9879_u76ee > 2 | ||
22 | end, (function() | ||
23 | return _u6620_u5c04(function(_u9879_u76ee) | ||
24 | return _u9879_u76ee * 2 | ||
25 | end, { | ||
26 | 1, | ||
27 | 2, | ||
28 | 3, | ||
29 | 4 | ||
30 | }) | ||
31 | end)()) | ||
32 | end | ||
33 | do | ||
34 | do | ||
35 | local _obj_0 = _u7f51_u7edc | ||
36 | if _obj_0 ~= nil then | ||
37 | _obj_0["获取"]("测试地址", function(_u6570_u636e) | ||
38 | local _call_0 = _u7f51_u9875_u4f53[".结果"] | ||
39 | _call_0["网页"](_call_0, _u6570_u636e) | ||
40 | return _u7f51_u7edc["请求"]("测试地址", _u6570_u636e, function(_u662f_u5426_u5904_u7406_u6210_u529f) | ||
41 | local _call_1 = _u7f51_u9875_u4f53[".结果"] | ||
42 | _call_1["添加"](_call_1, _u662f_u5426_u5904_u7406_u6210_u679c) | ||
43 | return _u8bbe_u7f6e_u8d85_u65f6_u56de_u8c03(1000, function() | ||
44 | return _u6253_u5370("完成") | ||
45 | end) | ||
46 | end) | ||
47 | end) | ||
48 | end | ||
49 | end | ||
50 | end | ||
51 | do | ||
52 | _u540c_u6b65_u72b6_u6001(function() | ||
53 | return _u5f02_u6b65_u52a0_u8f7d("文件.yue", function(_u9519_u8bef_u4fe1_u606f, _u6570_u636e) | ||
54 | if _u6570_u636e == nil then | ||
55 | _u6570_u636e = "nil" | ||
56 | end | ||
57 | if _u9519_u8bef_u4fe1_u606f then | ||
58 | _u6253_u5370(_u9519_u8bef_u4fe1_u606f) | ||
59 | return | ||
60 | end | ||
61 | return _u5f02_u6b65_u7f16_u8bd1(_u6570_u636e, function(_u4ee3_u7801) | ||
62 | local _u7ed3_u679c_u51fd_u6570 = _u52a0_u8f7d_u5b57_u7b26_u4e32(_u4ee3_u7801) | ||
63 | return _u7ed3_u679c_u51fd_u6570() | ||
64 | end) | ||
65 | end) | ||
66 | end) | ||
67 | end | ||
68 | do | ||
69 | _u51fd_u65701(function() | ||
70 | return _u51fd_u65702(function() | ||
71 | do | ||
72 | _u51fd_u65703(function() | ||
73 | return _u51fd_u65704(function() end) | ||
74 | end) | ||
75 | end | ||
76 | return _u51fd_u65705(function() | ||
77 | return _u51fd_u65706(function() | ||
78 | return _u51fd_u65707() | ||
79 | end) | ||
80 | end) | ||
81 | end) | ||
82 | end) | ||
83 | end | ||
84 | do | ||
85 | local _u7ed3_u679c, _u6d88_u606f | ||
86 | do | ||
87 | do | ||
88 | local _obj_0 = _u5f02_u6b65_u63a5_u6536("文件名.txt", function(_u6570_u636e) | ||
89 | _u6253_u5370(_u6570_u636e) | ||
90 | return _u5f02_u6b65_u5904_u7406(_u6570_u636e, function(_u4fe1_u606f) | ||
91 | return _u68c0_u67e5(_u4fe1_u606f) | ||
92 | end) | ||
93 | end) | ||
94 | _u7ed3_u679c, _u6d88_u606f = _obj_0["结果"], _obj_0["消息"] | ||
95 | end | ||
96 | end | ||
97 | _u6253_u5370(_u7ed3_u679c, _u6d88_u606f) | ||
98 | local _u603b_u5927_u5c0f = _u5408_u5e76(((function() | ||
99 | local _accum_0 = { } | ||
100 | local _len_0 = 1 | ||
101 | local _list_0 = _u6587_u4ef6_u6570_u7ec4 | ||
102 | for _index_0 = 1, #_list_0 do | ||
103 | local _u6587_u4ef6 = _list_0[_index_0] | ||
104 | _accum_0[_len_0] = _u5f02_u6b65_u52a0_u8f7d(_u6587_u4ef6, function(_u6570_u636e) | ||
105 | return _u52a0_u5165_u7f13_u5b58(_u6587_u4ef6, _u6570_u636e) | ||
106 | end) | ||
107 | _len_0 = _len_0 + 1 | ||
108 | end | ||
109 | return _accum_0 | ||
110 | end)()), 0, function(_u5bf9_u8c61a, _u5bf9_u8c61b) | ||
111 | return _u5bf9_u8c61a + _u5bf9_u8c61b | ||
112 | end) | ||
113 | end | ||
114 | local _u5c5e_u6027A | ||
115 | do | ||
116 | _u5c5e_u6027A = _u5c5e_u6027_u5b9a_u4e49(function(self) | ||
117 | return self["_值"] | ||
118 | end, function(self, _u503c) | ||
119 | _u6253_u5370("之前值: " .. tostring(self["_值"])) | ||
120 | _u6253_u5370("最新值: " .. tostring(_u503c)) | ||
121 | self["_值"] = _u503c | ||
122 | end) | ||
123 | end | ||
124 | local _u5c5e_u6027B | ||
125 | do | ||
126 | _u5c5e_u6027B = _u5c5e_u6027_u5b9a_u4e49(function(self) | ||
127 | return self["_值"] | ||
128 | end, function(self, _u503c) | ||
129 | _u6253_u5370("之前值: " .. tostring(self["_值"])) | ||
130 | _u6253_u5370("最新值: " .. tostring(_u503c)) | ||
131 | self["_值"] = _u503c | ||
132 | end) | ||
133 | end | ||
134 | _u8b66_u544a("嗨") | ||
135 | local _u53d8_u91cfx, _u53d8_u91cfy, _u53d8_u91cfz | ||
136 | do | ||
137 | _u53d8_u91cfx = (_u53d8_u91cfa) < -_u53d8_u91cfb | ||
138 | end | ||
139 | do | ||
140 | _u53d8_u91cfx, _u53d8_u91cfy, _u53d8_u91cfz = _u53d8_u91cfb(function(_u53d8_u91cfa) end) | ||
141 | end | ||
142 | do | ||
143 | _u53d8_u91cfx, _u53d8_u91cfy, _u53d8_u91cfz = _u53d8_u91cfb(function(_u53d8_u91cfa) end) | ||
144 | end | ||
145 | do | ||
146 | _u53d8_u91cfx = _u53d8_u91cfa <= _u53d8_u91cfb | ||
147 | end | ||
148 | do | ||
149 | _u53d8_u91cfx, _u53d8_u91cfy, _u53d8_u91cfz = _u53d8_u91cfb(function(self, _u53d8_u91cfa) end) | ||
150 | end | ||
151 | return nil | ||
diff --git a/spec/outputs/unicode/bubbling.lua b/spec/outputs/unicode/bubbling.lua new file mode 100644 index 0000000..cb8750d --- /dev/null +++ b/spec/outputs/unicode/bubbling.lua | |||
@@ -0,0 +1,123 @@ | |||
1 | local _u51fd_u6570 | ||
2 | _u51fd_u6570 = function(...) | ||
3 | return #{ | ||
4 | ... | ||
5 | } | ||
6 | end | ||
7 | local _u4e0d_u8981_u5192_u6ce1 | ||
8 | _u4e0d_u8981_u5192_u6ce1 = function() | ||
9 | local _accum_0 = { } | ||
10 | local _len_0 = 1 | ||
11 | for _u5143_u7d20 in (function(...) | ||
12 | return _u6253_u5370(...) | ||
13 | end)("你好") do | ||
14 | _accum_0[_len_0] = _u5143_u7d20 | ||
15 | _len_0 = _len_0 + 1 | ||
16 | end | ||
17 | return _accum_0 | ||
18 | end | ||
19 | local _u53d8_u91cfk | ||
20 | do | ||
21 | local _accum_0 = { } | ||
22 | local _len_0 = 1 | ||
23 | for _u5143_u7d20 in (function(...) | ||
24 | return _u6253_u5370(...) | ||
25 | end)("你好") do | ||
26 | _accum_0[_len_0] = _u5143_u7d20 | ||
27 | _len_0 = _len_0 + 1 | ||
28 | end | ||
29 | _u53d8_u91cfk = _accum_0 | ||
30 | end | ||
31 | local _u53d8_u91cfj | ||
32 | do | ||
33 | local _accum_0 = { } | ||
34 | local _len_0 = 1 | ||
35 | for _u8ba1_u6570 = 1, 10 do | ||
36 | _accum_0[_len_0] = function(...) | ||
37 | return _u6253_u5370(...) | ||
38 | end | ||
39 | _len_0 = _len_0 + 1 | ||
40 | end | ||
41 | _u53d8_u91cfj = _accum_0 | ||
42 | end | ||
43 | local _u53d8_u91cfm | ||
44 | _u53d8_u91cfm = function(...) | ||
45 | local _accum_0 = { } | ||
46 | local _len_0 = 1 | ||
47 | local _list_0 = { | ||
48 | ... | ||
49 | } | ||
50 | for _index_0 = 1, #_list_0 do | ||
51 | local _u5143_u7d20 = _list_0[_index_0] | ||
52 | if _u51fd_u6570(...) > 4 then | ||
53 | _accum_0[_len_0] = _u5143_u7d20 | ||
54 | _len_0 = _len_0 + 1 | ||
55 | end | ||
56 | end | ||
57 | return _accum_0 | ||
58 | end | ||
59 | local __u65e0_u6548_u53d8_u91cf | ||
60 | __u65e0_u6548_u53d8_u91cf = function(...) | ||
61 | local _u6570_u7ec4x | ||
62 | do | ||
63 | local _accum_0 = { } | ||
64 | local _len_0 = 1 | ||
65 | local _list_0 = { | ||
66 | ... | ||
67 | } | ||
68 | for _index_0 = 1, #_list_0 do | ||
69 | local _u8ba1_u6570 = _list_0[_index_0] | ||
70 | _accum_0[_len_0] = _u8ba1_u6570 | ||
71 | _len_0 = _len_0 + 1 | ||
72 | end | ||
73 | _u6570_u7ec4x = _accum_0 | ||
74 | end | ||
75 | local _u6570_u7ec4y | ||
76 | do | ||
77 | local _accum_0 = { } | ||
78 | local _len_0 = 1 | ||
79 | local _list_0 = { | ||
80 | ... | ||
81 | } | ||
82 | for _index_0 = 1, #_list_0 do | ||
83 | local _u5143_u7d20 = _list_0[_index_0] | ||
84 | _accum_0[_len_0] = _u5143_u7d20 | ||
85 | _len_0 = _len_0 + 1 | ||
86 | end | ||
87 | _u6570_u7ec4y = _accum_0 | ||
88 | end | ||
89 | local _u6570_u7ec4z | ||
90 | do | ||
91 | local _accum_0 = { } | ||
92 | local _len_0 = 1 | ||
93 | for _u5143_u7d20 in _u5217_u8868 do | ||
94 | if _u51fd_u6570(...) > 4 then | ||
95 | _accum_0[_len_0] = _u5143_u7d20 | ||
96 | _len_0 = _len_0 + 1 | ||
97 | end | ||
98 | end | ||
99 | _u6570_u7ec4z = _accum_0 | ||
100 | end | ||
101 | local _u6570_u7ec4a | ||
102 | do | ||
103 | local _accum_0 = { } | ||
104 | local _len_0 = 1 | ||
105 | for _u8ba1_u6570 = 1, 10 do | ||
106 | _accum_0[_len_0] = ... | ||
107 | _len_0 = _len_0 + 1 | ||
108 | end | ||
109 | _u6570_u7ec4a = _accum_0 | ||
110 | end | ||
111 | local _u6570_u7ec4b | ||
112 | do | ||
113 | local _accum_0 = { } | ||
114 | local _len_0 = 1 | ||
115 | for _u8ba1_u6570 = 1, 10 do | ||
116 | _accum_0[_len_0] = function(...) | ||
117 | return _u6253_u5370(...) | ||
118 | end | ||
119 | _len_0 = _len_0 + 1 | ||
120 | end | ||
121 | _u6570_u7ec4b = _accum_0 | ||
122 | end | ||
123 | end | ||
diff --git a/spec/outputs/unicode/class.lua b/spec/outputs/unicode/class.lua new file mode 100644 index 0000000..4d309e3 --- /dev/null +++ b/spec/outputs/unicode/class.lua | |||
@@ -0,0 +1,1242 @@ | |||
1 | local _u4f60_u597d | ||
2 | do | ||
3 | local _class_0 | ||
4 | local _base_0 = { | ||
5 | ["你好"] = function(self) | ||
6 | return _u6253_u5370(self["测试"], self["世界"]) | ||
7 | end, | ||
8 | __tostring = function(self) | ||
9 | return "你好 世界" | ||
10 | end | ||
11 | } | ||
12 | if _base_0.__index == nil then | ||
13 | _base_0.__index = _base_0 | ||
14 | end | ||
15 | _class_0 = setmetatable({ | ||
16 | __init = function(self, _u6d4b_u8bd5, _u4e16_u754c) | ||
17 | self["测试"] = _u6d4b_u8bd5 | ||
18 | self["世界"] = _u4e16_u754c | ||
19 | return _u6253_u5370("创建对象..") | ||
20 | end, | ||
21 | __base = _base_0, | ||
22 | __name = "你好" | ||
23 | }, { | ||
24 | __index = _base_0, | ||
25 | __call = function(cls, ...) | ||
26 | local _self_0 = setmetatable({ }, _base_0) | ||
27 | cls.__init(_self_0, ...) | ||
28 | return _self_0 | ||
29 | end | ||
30 | }) | ||
31 | _base_0.__class = _class_0 | ||
32 | _u4f60_u597d = _class_0 | ||
33 | end | ||
34 | local _u5bf9_u8c61x = _u4f60_u597d(1, 2) | ||
35 | _u5bf9_u8c61x["你好"](_u5bf9_u8c61x) | ||
36 | _u6253_u5370(_u5bf9_u8c61x) | ||
37 | local _u7b80_u5355 | ||
38 | do | ||
39 | local _class_0 | ||
40 | local _base_0 = { | ||
41 | ["酷"] = function(self) | ||
42 | return _u6253_u5370("酷") | ||
43 | end | ||
44 | } | ||
45 | if _base_0.__index == nil then | ||
46 | _base_0.__index = _base_0 | ||
47 | end | ||
48 | _class_0 = setmetatable({ | ||
49 | __init = function() end, | ||
50 | __base = _base_0, | ||
51 | __name = "简单" | ||
52 | }, { | ||
53 | __index = _base_0, | ||
54 | __call = function(cls, ...) | ||
55 | local _self_0 = setmetatable({ }, _base_0) | ||
56 | cls.__init(_self_0, ...) | ||
57 | return _self_0 | ||
58 | end | ||
59 | }) | ||
60 | _base_0.__class = _class_0 | ||
61 | _u7b80_u5355 = _class_0 | ||
62 | end | ||
63 | local _u4f0a_u514b_u65af | ||
64 | do | ||
65 | local _class_0 | ||
66 | local _parent_0 = _u7b80_u5355 | ||
67 | local _base_0 = { } | ||
68 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
69 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
70 | _base_0[_key_0] = _val_0 | ||
71 | end | ||
72 | end | ||
73 | if _base_0.__index == nil then | ||
74 | _base_0.__index = _base_0 | ||
75 | end | ||
76 | setmetatable(_base_0, _parent_0.__base) | ||
77 | _class_0 = setmetatable({ | ||
78 | __init = function(self) | ||
79 | return _u6253_u5370("你好已创建") | ||
80 | end, | ||
81 | __base = _base_0, | ||
82 | __name = "伊克斯", | ||
83 | __parent = _parent_0 | ||
84 | }, { | ||
85 | __index = function(cls, name) | ||
86 | local val = rawget(_base_0, name) | ||
87 | if val == nil then | ||
88 | local parent = rawget(cls, "__parent") | ||
89 | if parent then | ||
90 | return parent[name] | ||
91 | end | ||
92 | else | ||
93 | return val | ||
94 | end | ||
95 | end, | ||
96 | __call = function(cls, ...) | ||
97 | local _self_0 = setmetatable({ }, _base_0) | ||
98 | cls.__init(_self_0, ...) | ||
99 | return _self_0 | ||
100 | end | ||
101 | }) | ||
102 | _base_0.__class = _class_0 | ||
103 | if _parent_0.__inherited then | ||
104 | _parent_0.__inherited(_parent_0, _class_0) | ||
105 | end | ||
106 | _u4f0a_u514b_u65af = _class_0 | ||
107 | end | ||
108 | local x_u5bf9_u8c61 = _u4f0a_u514b_u65af() | ||
109 | x_u5bf9_u8c61["酷"](x_u5bf9_u8c61) | ||
110 | local _u55e8 | ||
111 | do | ||
112 | local _class_0 | ||
113 | local _base_0 = { | ||
114 | ["酷"] = function(self, _u6570_u503c) | ||
115 | return _u6253_u5370("数值", _u6570_u503c) | ||
116 | end | ||
117 | } | ||
118 | if _base_0.__index == nil then | ||
119 | _base_0.__index = _base_0 | ||
120 | end | ||
121 | _class_0 = setmetatable({ | ||
122 | __init = function(self, _u53c2_u6570) | ||
123 | return _u6253_u5370("初始化参数", _u53c2_u6570) | ||
124 | end, | ||
125 | __base = _base_0, | ||
126 | __name = "嗨" | ||
127 | }, { | ||
128 | __index = _base_0, | ||
129 | __call = function(cls, ...) | ||
130 | local _self_0 = setmetatable({ }, _base_0) | ||
131 | cls.__init(_self_0, ...) | ||
132 | return _self_0 | ||
133 | end | ||
134 | }) | ||
135 | _base_0.__class = _class_0 | ||
136 | _u55e8 = _class_0 | ||
137 | end | ||
138 | do | ||
139 | local _class_0 | ||
140 | local _parent_0 = _u55e8 | ||
141 | local _base_0 = { | ||
142 | ["酷"] = function(self) | ||
143 | return _class_0.__parent.__base["酷"](self, 120302) | ||
144 | end | ||
145 | } | ||
146 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
147 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
148 | _base_0[_key_0] = _val_0 | ||
149 | end | ||
150 | end | ||
151 | if _base_0.__index == nil then | ||
152 | _base_0.__index = _base_0 | ||
153 | end | ||
154 | setmetatable(_base_0, _parent_0.__base) | ||
155 | _class_0 = setmetatable({ | ||
156 | __init = function(self) | ||
157 | return _class_0.__parent.__init(self, "伙计") | ||
158 | end, | ||
159 | __base = _base_0, | ||
160 | __name = "简单", | ||
161 | __parent = _parent_0 | ||
162 | }, { | ||
163 | __index = function(cls, name) | ||
164 | local val = rawget(_base_0, name) | ||
165 | if val == nil then | ||
166 | local parent = rawget(cls, "__parent") | ||
167 | if parent then | ||
168 | return parent[name] | ||
169 | end | ||
170 | else | ||
171 | return val | ||
172 | end | ||
173 | end, | ||
174 | __call = function(cls, ...) | ||
175 | local _self_0 = setmetatable({ }, _base_0) | ||
176 | cls.__init(_self_0, ...) | ||
177 | return _self_0 | ||
178 | end | ||
179 | }) | ||
180 | _base_0.__class = _class_0 | ||
181 | if _parent_0.__inherited then | ||
182 | _parent_0.__inherited(_parent_0, _class_0) | ||
183 | end | ||
184 | _u7b80_u5355 = _class_0 | ||
185 | end | ||
186 | x_u5bf9_u8c61 = _u7b80_u5355() | ||
187 | x_u5bf9_u8c61["酷"](x_u5bf9_u8c61) | ||
188 | _u6253_u5370(x_u5bf9_u8c61.__class == _u7b80_u5355) | ||
189 | local _u597d_u5427 | ||
190 | do | ||
191 | local _class_0 | ||
192 | local _base_0 = { | ||
193 | ["一些东西"] = 20323 | ||
194 | } | ||
195 | if _base_0.__index == nil then | ||
196 | _base_0.__index = _base_0 | ||
197 | end | ||
198 | _class_0 = setmetatable({ | ||
199 | __init = function() end, | ||
200 | __base = _base_0, | ||
201 | __name = "好吧" | ||
202 | }, { | ||
203 | __index = _base_0, | ||
204 | __call = function(cls, ...) | ||
205 | local _self_0 = setmetatable({ }, _base_0) | ||
206 | cls.__init(_self_0, ...) | ||
207 | return _self_0 | ||
208 | end | ||
209 | }) | ||
210 | _base_0.__class = _class_0 | ||
211 | _u597d_u5427 = _class_0 | ||
212 | end | ||
213 | local _u597d_u54d2 | ||
214 | do | ||
215 | local _class_0 | ||
216 | local _parent_0 = _u597d_u5427 | ||
217 | local _base_0 = { | ||
218 | ["一些东西"] = function(self) | ||
219 | _class_0.__parent.__base["一些东西"](self, 1, 2, 3, 4) | ||
220 | _class_0.__parent["一些东西"](_u53e6_u4e00_u4e2a_u81ea_u5df1, 1, 2, 3, 4) | ||
221 | return _u65ad_u8a00(_class_0.__parent == _u597d_u5427) | ||
222 | end | ||
223 | } | ||
224 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
225 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
226 | _base_0[_key_0] = _val_0 | ||
227 | end | ||
228 | end | ||
229 | if _base_0.__index == nil then | ||
230 | _base_0.__index = _base_0 | ||
231 | end | ||
232 | setmetatable(_base_0, _parent_0.__base) | ||
233 | _class_0 = setmetatable({ | ||
234 | __init = function(self, ...) | ||
235 | return _class_0.__parent.__init(self, ...) | ||
236 | end, | ||
237 | __base = _base_0, | ||
238 | __name = "好哒", | ||
239 | __parent = _parent_0 | ||
240 | }, { | ||
241 | __index = function(cls, name) | ||
242 | local val = rawget(_base_0, name) | ||
243 | if val == nil then | ||
244 | local parent = rawget(cls, "__parent") | ||
245 | if parent then | ||
246 | return parent[name] | ||
247 | end | ||
248 | else | ||
249 | return val | ||
250 | end | ||
251 | end, | ||
252 | __call = function(cls, ...) | ||
253 | local _self_0 = setmetatable({ }, _base_0) | ||
254 | cls.__init(_self_0, ...) | ||
255 | return _self_0 | ||
256 | end | ||
257 | }) | ||
258 | _base_0.__class = _class_0 | ||
259 | if _parent_0.__inherited then | ||
260 | _parent_0.__inherited(_parent_0, _class_0) | ||
261 | end | ||
262 | _u597d_u54d2 = _class_0 | ||
263 | end | ||
264 | local _u597d | ||
265 | do | ||
266 | local _class_0 | ||
267 | local _base_0 = { | ||
268 | ["不错"] = function(self) | ||
269 | local _call_0 = _class_0.__parent | ||
270 | return _call_0["一些东西"](_call_0, self, 1, 2, 3, 4) | ||
271 | end | ||
272 | } | ||
273 | if _base_0.__index == nil then | ||
274 | _base_0.__index = _base_0 | ||
275 | end | ||
276 | _class_0 = setmetatable({ | ||
277 | __init = function() end, | ||
278 | __base = _base_0, | ||
279 | __name = "好" | ||
280 | }, { | ||
281 | __index = _base_0, | ||
282 | __call = function(cls, ...) | ||
283 | local _self_0 = setmetatable({ }, _base_0) | ||
284 | cls.__init(_self_0, ...) | ||
285 | return _self_0 | ||
286 | end | ||
287 | }) | ||
288 | _base_0.__class = _class_0 | ||
289 | _u597d = _class_0 | ||
290 | end | ||
291 | local _u4ec0_u4e48 | ||
292 | do | ||
293 | local _class_0 | ||
294 | local _base_0 = { | ||
295 | ["一些东西"] = function(self) | ||
296 | return _u6253_u5370("值:", self["值"]) | ||
297 | end | ||
298 | } | ||
299 | if _base_0.__index == nil then | ||
300 | _base_0.__index = _base_0 | ||
301 | end | ||
302 | _class_0 = setmetatable({ | ||
303 | __init = function() end, | ||
304 | __base = _base_0, | ||
305 | __name = "什么" | ||
306 | }, { | ||
307 | __index = _base_0, | ||
308 | __call = function(cls, ...) | ||
309 | local _self_0 = setmetatable({ }, _base_0) | ||
310 | cls.__init(_self_0, ...) | ||
311 | return _self_0 | ||
312 | end | ||
313 | }) | ||
314 | _base_0.__class = _class_0 | ||
315 | _u4ec0_u4e48 = _class_0 | ||
316 | end | ||
317 | do | ||
318 | local _class_0 | ||
319 | local _parent_0 = _u4ec0_u4e48 | ||
320 | local _base_0 = { | ||
321 | ["值"] = 2323, | ||
322 | ["一些东西"] = function(self) | ||
323 | local _base_1 = _class_0.__parent | ||
324 | local _fn_0 = _base_1["一些东西"] | ||
325 | return _fn_0 and function(...) | ||
326 | return _fn_0(_base_1, ...) | ||
327 | end | ||
328 | end | ||
329 | } | ||
330 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
331 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
332 | _base_0[_key_0] = _val_0 | ||
333 | end | ||
334 | end | ||
335 | if _base_0.__index == nil then | ||
336 | _base_0.__index = _base_0 | ||
337 | end | ||
338 | setmetatable(_base_0, _parent_0.__base) | ||
339 | _class_0 = setmetatable({ | ||
340 | __init = function(self, ...) | ||
341 | return _class_0.__parent.__init(self, ...) | ||
342 | end, | ||
343 | __base = _base_0, | ||
344 | __name = "你好", | ||
345 | __parent = _parent_0 | ||
346 | }, { | ||
347 | __index = function(cls, name) | ||
348 | local val = rawget(_base_0, name) | ||
349 | if val == nil then | ||
350 | local parent = rawget(cls, "__parent") | ||
351 | if parent then | ||
352 | return parent[name] | ||
353 | end | ||
354 | else | ||
355 | return val | ||
356 | end | ||
357 | end, | ||
358 | __call = function(cls, ...) | ||
359 | local _self_0 = setmetatable({ }, _base_0) | ||
360 | cls.__init(_self_0, ...) | ||
361 | return _self_0 | ||
362 | end | ||
363 | }) | ||
364 | _base_0.__class = _class_0 | ||
365 | if _parent_0.__inherited then | ||
366 | _parent_0.__inherited(_parent_0, _class_0) | ||
367 | end | ||
368 | _u4f60_u597d = _class_0 | ||
369 | end | ||
370 | do | ||
371 | local _with_0 = _u4f60_u597d() | ||
372 | _u5bf9_u8c61x = _with_0["一些对象"](_with_0) | ||
373 | _u6253_u5370(_u5bf9_u8c61x) | ||
374 | _u5bf9_u8c61x() | ||
375 | end | ||
376 | local _u8d85_u7ea7_u9177 | ||
377 | do | ||
378 | local _class_0 | ||
379 | local _base_0 = { | ||
380 | ["👋"] = function(self) | ||
381 | _class_0.__parent.__base["👋"](self, 1, 2, 3, 4)(1, 2, 3, 4) | ||
382 | _class_0.__parent["一些东西"](1, 2, 3, 4) | ||
383 | local _ = _class_0.__parent["一些东西"](1, 2, 3, 4)["世界"] | ||
384 | local _call_0 = _class_0.__parent | ||
385 | _call_0["好吧"](_call_0, self, "世界")["不错"](_u54c8, _u54c8, _u54c8) | ||
386 | _ = _u4e00_u4e9b_u4e1c_u897f["上级"] | ||
387 | _ = _class_0.__parent["上级"]["上级"]["上级"] | ||
388 | do | ||
389 | local _base_1 = _class_0.__parent | ||
390 | local _fn_0 = _base_1["你好"] | ||
391 | _ = _fn_0 and function(...) | ||
392 | return _fn_0(_base_1, ...) | ||
393 | end | ||
394 | end | ||
395 | return nil | ||
396 | end | ||
397 | } | ||
398 | if _base_0.__index == nil then | ||
399 | _base_0.__index = _base_0 | ||
400 | end | ||
401 | _class_0 = setmetatable({ | ||
402 | __init = function() end, | ||
403 | __base = _base_0, | ||
404 | __name = "超级酷" | ||
405 | }, { | ||
406 | __index = _base_0, | ||
407 | __call = function(cls, ...) | ||
408 | local _self_0 = setmetatable({ }, _base_0) | ||
409 | cls.__init(_self_0, ...) | ||
410 | return _self_0 | ||
411 | end | ||
412 | }) | ||
413 | _base_0.__class = _class_0 | ||
414 | _u8d85_u7ea7_u9177 = _class_0 | ||
415 | end | ||
416 | local _u53d8_u91cfx = self["你好"] | ||
417 | _u53d8_u91cfx = self.__class["你好"] | ||
418 | self["你好"](self, "世界") | ||
419 | self.__class["你好"](self.__class, "世界") | ||
420 | self.__class["一"](self.__class, self.__class["二"](self.__class, 4, 5)(self["三"], self["四"])) | ||
421 | local _u53d8_u91cfxx | ||
422 | _u53d8_u91cfxx = function(_u4f60_u597d, _u4e16_u754c, _u9177) | ||
423 | self["你好"] = _u4f60_u597d | ||
424 | self.__class["世界"] = _u4e16_u754c | ||
425 | end | ||
426 | local _u4e00_u4e2a_u7c7b | ||
427 | do | ||
428 | local _class_0 | ||
429 | local _base_0 = { | ||
430 | ["蓝色"] = function(self) end, | ||
431 | ["绿色"] = function(self) end | ||
432 | } | ||
433 | if _base_0.__index == nil then | ||
434 | _base_0.__index = _base_0 | ||
435 | end | ||
436 | _class_0 = setmetatable({ | ||
437 | __init = function() end, | ||
438 | __base = _base_0, | ||
439 | __name = "一个类" | ||
440 | }, { | ||
441 | __index = _base_0, | ||
442 | __call = function(cls, ...) | ||
443 | local _self_0 = setmetatable({ }, _base_0) | ||
444 | cls.__init(_self_0, ...) | ||
445 | return _self_0 | ||
446 | end | ||
447 | }) | ||
448 | _base_0.__class = _class_0 | ||
449 | local self = _class_0; | ||
450 | self["好"] = 343 | ||
451 | self["你好"] = 3434 | ||
452 | self["世界"] = 23423 | ||
453 | self["红色"] = function(self) end | ||
454 | _u4e00_u4e2a_u7c7b = _class_0 | ||
455 | end | ||
456 | _u53d8_u91cfx = self | ||
457 | local _u53d8_u91cfy = self.__class | ||
458 | self(_u4e00_u4e9b_u4e1c_u897f) | ||
459 | self.__class(_u4e00_u4e9b_u4e1c_u897f) | ||
460 | local self = self + self / self | ||
461 | self = 343 | ||
462 | self["你好"](2, 3, 4) | ||
463 | local _ = _u4f60_u597d[self]["世界"] | ||
464 | local _u602a_u602a_u7684 | ||
465 | do | ||
466 | local _class_0 | ||
467 | local _base_0 = { } | ||
468 | if _base_0.__index == nil then | ||
469 | _base_0.__index = _base_0 | ||
470 | end | ||
471 | _class_0 = setmetatable({ | ||
472 | __init = function() end, | ||
473 | __base = _base_0, | ||
474 | __name = "怪怪的" | ||
475 | }, { | ||
476 | __index = _base_0, | ||
477 | __call = function(cls, ...) | ||
478 | local _self_0 = setmetatable({ }, _base_0) | ||
479 | cls.__init(_self_0, ...) | ||
480 | return _self_0 | ||
481 | end | ||
482 | }) | ||
483 | _base_0.__class = _class_0 | ||
484 | local self = _class_0; | ||
485 | _ = self["你好"] | ||
486 | if _u4e00_u4e9b_u4e1c_u897f then | ||
487 | _u6253_u5370("你好世界") | ||
488 | end | ||
489 | _u4f60_u597d = "世界" | ||
490 | self["另一"] = "天" | ||
491 | if _u4e00_u4e9b_u4e1c_u897f then | ||
492 | _u6253_u5370("好") | ||
493 | end | ||
494 | _u602a_u602a_u7684 = _class_0 | ||
495 | end | ||
496 | _u6253_u5370("你好") | ||
497 | local _u53d8_u91cfyyy | ||
498 | _u53d8_u91cfyyy = function() | ||
499 | local _u9177 | ||
500 | do | ||
501 | local _class_0 | ||
502 | local _base_0 = { } | ||
503 | if _base_0.__index == nil then | ||
504 | _base_0.__index = _base_0 | ||
505 | end | ||
506 | _class_0 = setmetatable({ | ||
507 | __init = function() end, | ||
508 | __base = _base_0, | ||
509 | __name = "酷" | ||
510 | }, { | ||
511 | __index = _base_0, | ||
512 | __call = function(cls, ...) | ||
513 | local _self_0 = setmetatable({ }, _base_0) | ||
514 | cls.__init(_self_0, ...) | ||
515 | return _self_0 | ||
516 | end | ||
517 | }) | ||
518 | _base_0.__class = _class_0 | ||
519 | local self = _class_0; | ||
520 | _ = nil | ||
521 | _u9177 = _class_0 | ||
522 | return _class_0 | ||
523 | end | ||
524 | end | ||
525 | do | ||
526 | local _class_0 | ||
527 | local _base_0 = { } | ||
528 | if _base_0.__index == nil then | ||
529 | _base_0.__index = _base_0 | ||
530 | end | ||
531 | _class_0 = setmetatable({ | ||
532 | __init = function() end, | ||
533 | __base = _base_0, | ||
534 | __name = "子类D" | ||
535 | }, { | ||
536 | __index = _base_0, | ||
537 | __call = function(cls, ...) | ||
538 | local _self_0 = setmetatable({ }, _base_0) | ||
539 | cls.__init(_self_0, ...) | ||
540 | return _self_0 | ||
541 | end | ||
542 | }) | ||
543 | _base_0.__class = _class_0 | ||
544 | local self = _class_0; | ||
545 | _ = nil | ||
546 | _u5bf9_u8c61a["字段b"]["字段c"]["子类D"] = _class_0 | ||
547 | end | ||
548 | do | ||
549 | local _class_0 | ||
550 | local _base_0 = { } | ||
551 | if _base_0.__index == nil then | ||
552 | _base_0.__index = _base_0 | ||
553 | end | ||
554 | _class_0 = setmetatable({ | ||
555 | __init = function() end, | ||
556 | __base = _base_0, | ||
557 | __name = "你好" | ||
558 | }, { | ||
559 | __index = _base_0, | ||
560 | __call = function(cls, ...) | ||
561 | local _self_0 = setmetatable({ }, _base_0) | ||
562 | cls.__init(_self_0, ...) | ||
563 | return _self_0 | ||
564 | end | ||
565 | }) | ||
566 | _base_0.__class = _class_0 | ||
567 | local self = _class_0; | ||
568 | _ = nil | ||
569 | _u5bf9_u8c61a["字段b"]["你好"] = _class_0 | ||
570 | end | ||
571 | do | ||
572 | local _class_0 | ||
573 | local _parent_0 = _u4f60_u597d["世界"] | ||
574 | local _base_0 = { } | ||
575 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
576 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
577 | _base_0[_key_0] = _val_0 | ||
578 | end | ||
579 | end | ||
580 | if _base_0.__index == nil then | ||
581 | _base_0.__index = _base_0 | ||
582 | end | ||
583 | setmetatable(_base_0, _parent_0.__base) | ||
584 | _class_0 = setmetatable({ | ||
585 | __init = function(self, ...) | ||
586 | return _class_0.__parent.__init(self, ...) | ||
587 | end, | ||
588 | __base = _base_0, | ||
589 | __name = "某个成员", | ||
590 | __parent = _parent_0 | ||
591 | }, { | ||
592 | __index = function(cls, name) | ||
593 | local val = rawget(_base_0, name) | ||
594 | if val == nil then | ||
595 | local parent = rawget(cls, "__parent") | ||
596 | if parent then | ||
597 | return parent[name] | ||
598 | end | ||
599 | else | ||
600 | return val | ||
601 | end | ||
602 | end, | ||
603 | __call = function(cls, ...) | ||
604 | local _self_0 = setmetatable({ }, _base_0) | ||
605 | cls.__init(_self_0, ...) | ||
606 | return _self_0 | ||
607 | end | ||
608 | }) | ||
609 | _base_0.__class = _class_0 | ||
610 | local self = _class_0; | ||
611 | _ = nil | ||
612 | if _parent_0.__inherited then | ||
613 | _parent_0.__inherited(_parent_0, _class_0) | ||
614 | end | ||
615 | (function() | ||
616 | return require("moon") | ||
617 | end)()["某个成员"] = _class_0 | ||
618 | end | ||
619 | local _u7c7ba | ||
620 | do | ||
621 | local _class_0 | ||
622 | local _base_0 = { } | ||
623 | if _base_0.__index == nil then | ||
624 | _base_0.__index = _base_0 | ||
625 | end | ||
626 | _class_0 = setmetatable({ | ||
627 | __init = function() end, | ||
628 | __base = _base_0, | ||
629 | __name = "类a" | ||
630 | }, { | ||
631 | __index = _base_0, | ||
632 | __call = function(cls, ...) | ||
633 | local _self_0 = setmetatable({ }, _base_0) | ||
634 | cls.__init(_self_0, ...) | ||
635 | return _self_0 | ||
636 | end | ||
637 | }) | ||
638 | _base_0.__class = _class_0 | ||
639 | _u7c7ba = _class_0 | ||
640 | end | ||
641 | local _u7c7bb | ||
642 | do | ||
643 | local _class_0 | ||
644 | local _base_0 = { } | ||
645 | if _base_0.__index == nil then | ||
646 | _base_0.__index = _base_0 | ||
647 | end | ||
648 | _class_0 = setmetatable({ | ||
649 | __init = function() end, | ||
650 | __base = _base_0, | ||
651 | __name = "一个类" | ||
652 | }, { | ||
653 | __index = _base_0, | ||
654 | __call = function(cls, ...) | ||
655 | local _self_0 = setmetatable({ }, _base_0) | ||
656 | cls.__init(_self_0, ...) | ||
657 | return _self_0 | ||
658 | end | ||
659 | }) | ||
660 | _base_0.__class = _class_0 | ||
661 | _u4e00_u4e2a_u7c7b = _class_0 | ||
662 | _u7c7bb = _class_0 | ||
663 | end | ||
664 | local _u7c7bc | ||
665 | do | ||
666 | local _class_0 | ||
667 | local _parent_0 = _u4f60_u597d | ||
668 | local _base_0 = { } | ||
669 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
670 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
671 | _base_0[_key_0] = _val_0 | ||
672 | end | ||
673 | end | ||
674 | if _base_0.__index == nil then | ||
675 | _base_0.__index = _base_0 | ||
676 | end | ||
677 | setmetatable(_base_0, _parent_0.__base) | ||
678 | _class_0 = setmetatable({ | ||
679 | __init = function(self, ...) | ||
680 | return _class_0.__parent.__init(self, ...) | ||
681 | end, | ||
682 | __base = _base_0, | ||
683 | __name = "一个类", | ||
684 | __parent = _parent_0 | ||
685 | }, { | ||
686 | __index = function(cls, name) | ||
687 | local val = rawget(_base_0, name) | ||
688 | if val == nil then | ||
689 | local parent = rawget(cls, "__parent") | ||
690 | if parent then | ||
691 | return parent[name] | ||
692 | end | ||
693 | else | ||
694 | return val | ||
695 | end | ||
696 | end, | ||
697 | __call = function(cls, ...) | ||
698 | local _self_0 = setmetatable({ }, _base_0) | ||
699 | cls.__init(_self_0, ...) | ||
700 | return _self_0 | ||
701 | end | ||
702 | }) | ||
703 | _base_0.__class = _class_0 | ||
704 | if _parent_0.__inherited then | ||
705 | _parent_0.__inherited(_parent_0, _class_0) | ||
706 | end | ||
707 | _u4e00_u4e2a_u7c7b = _class_0 | ||
708 | _u7c7bc = _class_0 | ||
709 | end | ||
710 | local _u7c7bd | ||
711 | do | ||
712 | local _class_0 | ||
713 | local _parent_0 = _u4e16_u754c | ||
714 | local _base_0 = { } | ||
715 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
716 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
717 | _base_0[_key_0] = _val_0 | ||
718 | end | ||
719 | end | ||
720 | if _base_0.__index == nil then | ||
721 | _base_0.__index = _base_0 | ||
722 | end | ||
723 | setmetatable(_base_0, _parent_0.__base) | ||
724 | _class_0 = setmetatable({ | ||
725 | __init = function(self, ...) | ||
726 | return _class_0.__parent.__init(self, ...) | ||
727 | end, | ||
728 | __base = _base_0, | ||
729 | __name = "类d", | ||
730 | __parent = _parent_0 | ||
731 | }, { | ||
732 | __index = function(cls, name) | ||
733 | local val = rawget(_base_0, name) | ||
734 | if val == nil then | ||
735 | local parent = rawget(cls, "__parent") | ||
736 | if parent then | ||
737 | return parent[name] | ||
738 | end | ||
739 | else | ||
740 | return val | ||
741 | end | ||
742 | end, | ||
743 | __call = function(cls, ...) | ||
744 | local _self_0 = setmetatable({ }, _base_0) | ||
745 | cls.__init(_self_0, ...) | ||
746 | return _self_0 | ||
747 | end | ||
748 | }) | ||
749 | _base_0.__class = _class_0 | ||
750 | if _parent_0.__inherited then | ||
751 | _parent_0.__inherited(_parent_0, _class_0) | ||
752 | end | ||
753 | _u7c7bd = _class_0 | ||
754 | end | ||
755 | _u6253_u5370(((function() | ||
756 | local _u5565_u4e8b | ||
757 | do | ||
758 | local _class_0 | ||
759 | local _base_0 = { } | ||
760 | if _base_0.__index == nil then | ||
761 | _base_0.__index = _base_0 | ||
762 | end | ||
763 | _class_0 = setmetatable({ | ||
764 | __init = function() end, | ||
765 | __base = _base_0, | ||
766 | __name = "啥事" | ||
767 | }, { | ||
768 | __index = _base_0, | ||
769 | __call = function(cls, ...) | ||
770 | local _self_0 = setmetatable({ }, _base_0) | ||
771 | cls.__init(_self_0, ...) | ||
772 | return _self_0 | ||
773 | end | ||
774 | }) | ||
775 | _base_0.__class = _class_0 | ||
776 | _u5565_u4e8b = _class_0 | ||
777 | return _class_0 | ||
778 | end | ||
779 | end)()).__name) | ||
780 | do | ||
781 | local _class_0 | ||
782 | local _base_0 = { } | ||
783 | if _base_0.__index == nil then | ||
784 | _base_0.__index = _base_0 | ||
785 | end | ||
786 | _class_0 = setmetatable({ | ||
787 | __init = function() end, | ||
788 | __base = _base_0, | ||
789 | __name = "一个类" | ||
790 | }, { | ||
791 | __index = _base_0, | ||
792 | __call = function(cls, ...) | ||
793 | local _self_0 = setmetatable({ }, _base_0) | ||
794 | cls.__init(_self_0, ...) | ||
795 | return _self_0 | ||
796 | end | ||
797 | }) | ||
798 | _base_0.__class = _class_0 | ||
799 | local self = _class_0; | ||
800 | _ = nil | ||
801 | _u4e00_u4e2a_u7c7b = _class_0 | ||
802 | end | ||
803 | do | ||
804 | local _class_0 | ||
805 | local _u503c, _u63d2_u5165 | ||
806 | local _base_0 = { } | ||
807 | if _base_0.__index == nil then | ||
808 | _base_0.__index = _base_0 | ||
809 | end | ||
810 | _class_0 = setmetatable({ | ||
811 | __init = function(self) | ||
812 | return _u6253_u5370(_u63d2_u5165, _u503c) | ||
813 | end, | ||
814 | __base = _base_0, | ||
815 | __name = "一个类" | ||
816 | }, { | ||
817 | __index = _base_0, | ||
818 | __call = function(cls, ...) | ||
819 | local _self_0 = setmetatable({ }, _base_0) | ||
820 | cls.__init(_self_0, ...) | ||
821 | return _self_0 | ||
822 | end | ||
823 | }) | ||
824 | _base_0.__class = _class_0 | ||
825 | local self = _class_0; | ||
826 | _u503c = 23 | ||
827 | _u63d2_u5165 = _u8868["插入"] | ||
828 | _u4e00_u4e2a_u7c7b = _class_0 | ||
829 | end | ||
830 | do | ||
831 | local _class_0 | ||
832 | local _base_0 = { } | ||
833 | if _base_0.__index == nil then | ||
834 | _base_0.__index = _base_0 | ||
835 | end | ||
836 | _class_0 = setmetatable({ | ||
837 | __init = _u55e8, | ||
838 | __base = _base_0, | ||
839 | __name = "X类" | ||
840 | }, { | ||
841 | __index = _base_0, | ||
842 | __call = function(cls, ...) | ||
843 | local _self_0 = setmetatable({ }, _base_0) | ||
844 | cls.__init(_self_0, ...) | ||
845 | return _self_0 | ||
846 | end | ||
847 | }) | ||
848 | _base_0.__class = _class_0 | ||
849 | X_u7c7b = _class_0 | ||
850 | end | ||
851 | local _u9177 | ||
852 | do | ||
853 | local _class_0 | ||
854 | local _parent_0 = _u4e1c_u897f | ||
855 | local _base_0 = { | ||
856 | ["当"] = function(self) | ||
857 | return { | ||
858 | ["你好"] = function() | ||
859 | return _class_0.__parent.__base["当"](self) | ||
860 | end, | ||
861 | ["世界"] = function() | ||
862 | return _class_0.__parent.one | ||
863 | end | ||
864 | } | ||
865 | end | ||
866 | } | ||
867 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
868 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
869 | _base_0[_key_0] = _val_0 | ||
870 | end | ||
871 | end | ||
872 | if _base_0.__index == nil then | ||
873 | _base_0.__index = _base_0 | ||
874 | end | ||
875 | setmetatable(_base_0, _parent_0.__base) | ||
876 | _class_0 = setmetatable({ | ||
877 | __init = function(self, ...) | ||
878 | return _class_0.__parent.__init(self, ...) | ||
879 | end, | ||
880 | __base = _base_0, | ||
881 | __name = "酷", | ||
882 | __parent = _parent_0 | ||
883 | }, { | ||
884 | __index = function(cls, name) | ||
885 | local val = rawget(_base_0, name) | ||
886 | if val == nil then | ||
887 | local parent = rawget(cls, "__parent") | ||
888 | if parent then | ||
889 | return parent[name] | ||
890 | end | ||
891 | else | ||
892 | return val | ||
893 | end | ||
894 | end, | ||
895 | __call = function(cls, ...) | ||
896 | local _self_0 = setmetatable({ }, _base_0) | ||
897 | cls.__init(_self_0, ...) | ||
898 | return _self_0 | ||
899 | end | ||
900 | }) | ||
901 | _base_0.__class = _class_0 | ||
902 | if _parent_0.__inherited then | ||
903 | _parent_0.__inherited(_parent_0, _class_0) | ||
904 | end | ||
905 | _u9177 = _class_0 | ||
906 | end | ||
907 | local _u5947_u602a | ||
908 | do | ||
909 | local _class_0 | ||
910 | local _parent_0 = _u4e1c_u897f | ||
911 | local _base_0 = { | ||
912 | ["当"] = _u505a_u70b9_u4e8b(function(self) | ||
913 | return _class_0.__parent.__base["当"](self) | ||
914 | end) | ||
915 | } | ||
916 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
917 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
918 | _base_0[_key_0] = _val_0 | ||
919 | end | ||
920 | end | ||
921 | if _base_0.__index == nil then | ||
922 | _base_0.__index = _base_0 | ||
923 | end | ||
924 | setmetatable(_base_0, _parent_0.__base) | ||
925 | _class_0 = setmetatable({ | ||
926 | __init = function(self, ...) | ||
927 | return _class_0.__parent.__init(self, ...) | ||
928 | end, | ||
929 | __base = _base_0, | ||
930 | __name = "奇怪", | ||
931 | __parent = _parent_0 | ||
932 | }, { | ||
933 | __index = function(cls, name) | ||
934 | local val = rawget(_base_0, name) | ||
935 | if val == nil then | ||
936 | local parent = rawget(cls, "__parent") | ||
937 | if parent then | ||
938 | return parent[name] | ||
939 | end | ||
940 | else | ||
941 | return val | ||
942 | end | ||
943 | end, | ||
944 | __call = function(cls, ...) | ||
945 | local _self_0 = setmetatable({ }, _base_0) | ||
946 | cls.__init(_self_0, ...) | ||
947 | return _self_0 | ||
948 | end | ||
949 | }) | ||
950 | _base_0.__class = _class_0 | ||
951 | if _parent_0.__inherited then | ||
952 | _parent_0.__inherited(_parent_0, _class_0) | ||
953 | end | ||
954 | _u5947_u602a = _class_0 | ||
955 | end | ||
956 | local _u5594_u54c8 | ||
957 | do | ||
958 | local _class_0 | ||
959 | local _parent_0 = _u4e1c_u897f | ||
960 | local _base_0 = { } | ||
961 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
962 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
963 | _base_0[_key_0] = _val_0 | ||
964 | end | ||
965 | end | ||
966 | if _base_0.__index == nil then | ||
967 | _base_0.__index = _base_0 | ||
968 | end | ||
969 | setmetatable(_base_0, _parent_0.__base) | ||
970 | _class_0 = setmetatable({ | ||
971 | __init = function(self, ...) | ||
972 | return _class_0.__parent.__init(self, ...) | ||
973 | end, | ||
974 | __base = _base_0, | ||
975 | __name = "喔哈", | ||
976 | __parent = _parent_0 | ||
977 | }, { | ||
978 | __index = function(cls, name) | ||
979 | local val = rawget(_base_0, name) | ||
980 | if val == nil then | ||
981 | local parent = rawget(cls, "__parent") | ||
982 | if parent then | ||
983 | return parent[name] | ||
984 | end | ||
985 | else | ||
986 | return val | ||
987 | end | ||
988 | end, | ||
989 | __call = function(cls, ...) | ||
990 | local _self_0 = setmetatable({ }, _base_0) | ||
991 | cls.__init(_self_0, ...) | ||
992 | return _self_0 | ||
993 | end | ||
994 | }) | ||
995 | _base_0.__class = _class_0 | ||
996 | local self = _class_0; | ||
997 | self["底部"] = function() | ||
998 | _class_0.__parent["底部"](self) | ||
999 | _ = _class_0.__parent["你好"] | ||
1000 | local _call_0 = _class_0.__parent | ||
1001 | _call_0["你好"](_call_0, self) | ||
1002 | local _base_1 = _class_0.__parent | ||
1003 | local _fn_0 = _base_1["你好"] | ||
1004 | return _fn_0 and function(...) | ||
1005 | return _fn_0(_base_1, ...) | ||
1006 | end | ||
1007 | end | ||
1008 | self["空间"] = _u9177({ | ||
1009 | function() | ||
1010 | _class_0.__parent["空间"](self) | ||
1011 | _ = _class_0.__parent["你好"] | ||
1012 | local _call_0 = _class_0.__parent | ||
1013 | _call_0["你好"](_call_0, self) | ||
1014 | local _base_1 = _class_0.__parent | ||
1015 | local _fn_0 = _base_1["你好"] | ||
1016 | return _fn_0 and function(...) | ||
1017 | return _fn_0(_base_1, ...) | ||
1018 | end | ||
1019 | end | ||
1020 | }) | ||
1021 | if _parent_0.__inherited then | ||
1022 | _parent_0.__inherited(_parent_0, _class_0) | ||
1023 | end | ||
1024 | _u5594_u54c8 = _class_0 | ||
1025 | end | ||
1026 | do | ||
1027 | local _u6d4b_u8bd5 | ||
1028 | do | ||
1029 | local _class_0 | ||
1030 | local _base_0 = { | ||
1031 | ["测试"] = function(self) | ||
1032 | return self.__class["如果"] and self.__class["做"](self.__class) | ||
1033 | end | ||
1034 | } | ||
1035 | if _base_0.__index == nil then | ||
1036 | _base_0.__index = _base_0 | ||
1037 | end | ||
1038 | _class_0 = setmetatable({ | ||
1039 | __init = function(self) | ||
1040 | self.__class["如果"] = true | ||
1041 | end, | ||
1042 | __base = _base_0, | ||
1043 | __name = "测试" | ||
1044 | }, { | ||
1045 | __index = _base_0, | ||
1046 | __call = function(cls, ...) | ||
1047 | local _self_0 = setmetatable({ }, _base_0) | ||
1048 | cls.__init(_self_0, ...) | ||
1049 | return _self_0 | ||
1050 | end | ||
1051 | }) | ||
1052 | _base_0.__class = _class_0 | ||
1053 | local self = _class_0; | ||
1054 | self["做"] = function(self) | ||
1055 | return 1 | ||
1056 | end | ||
1057 | _u6d4b_u8bd5 = _class_0 | ||
1058 | end | ||
1059 | local _u6d4b_u8bd5_u5b9e_u4f8b = _u6d4b_u8bd5() | ||
1060 | _u6d4b_u8bd5_u5b9e_u4f8b["测试"](_u6d4b_u8bd5_u5b9e_u4f8b) | ||
1061 | end | ||
1062 | do | ||
1063 | local _u6d4b_u8bd5 | ||
1064 | do | ||
1065 | local _class_0 | ||
1066 | local _base_0 = { | ||
1067 | ["做"] = function(self) | ||
1068 | return 1 | ||
1069 | end, | ||
1070 | ["测试"] = function(self) | ||
1071 | return self["如果"] and self["做"](self) | ||
1072 | end | ||
1073 | } | ||
1074 | if _base_0.__index == nil then | ||
1075 | _base_0.__index = _base_0 | ||
1076 | end | ||
1077 | _class_0 = setmetatable({ | ||
1078 | __init = function(self) | ||
1079 | self["如果"] = true | ||
1080 | end, | ||
1081 | __base = _base_0, | ||
1082 | __name = "测试" | ||
1083 | }, { | ||
1084 | __index = _base_0, | ||
1085 | __call = function(cls, ...) | ||
1086 | local _self_0 = setmetatable({ }, _base_0) | ||
1087 | cls.__init(_self_0, ...) | ||
1088 | return _self_0 | ||
1089 | end | ||
1090 | }) | ||
1091 | _base_0.__class = _class_0 | ||
1092 | _u6d4b_u8bd5 = _class_0 | ||
1093 | end | ||
1094 | local _u6d4b_u8bd5_u5b9e_u4f8b = _u6d4b_u8bd5() | ||
1095 | _u6d4b_u8bd5_u5b9e_u4f8b["测试"](_u6d4b_u8bd5_u5b9e_u4f8b) | ||
1096 | end | ||
1097 | do | ||
1098 | local _class_0 | ||
1099 | local _parent_0 = _u9752["应用"] | ||
1100 | local _base_0 = { | ||
1101 | ["/"] = function(self) | ||
1102 | return { | ||
1103 | json = { | ||
1104 | ["状态"] = true | ||
1105 | } | ||
1106 | } | ||
1107 | end | ||
1108 | } | ||
1109 | for _key_0, _val_0 in pairs(_parent_0.__base) do | ||
1110 | if _base_0[_key_0] == nil and _key_0:match("^__") and not (_key_0 == "__index" and _val_0 == _parent_0.__base) then | ||
1111 | _base_0[_key_0] = _val_0 | ||
1112 | end | ||
1113 | end | ||
1114 | if _base_0.__index == nil then | ||
1115 | _base_0.__index = _base_0 | ||
1116 | end | ||
1117 | setmetatable(_base_0, _parent_0.__base) | ||
1118 | _class_0 = setmetatable({ | ||
1119 | __init = function(self, ...) | ||
1120 | return _class_0.__parent.__init(self, ...) | ||
1121 | end, | ||
1122 | __base = _base_0, | ||
1123 | __parent = _parent_0 | ||
1124 | }, { | ||
1125 | __index = function(cls, name) | ||
1126 | local val = rawget(_base_0, name) | ||
1127 | if val == nil then | ||
1128 | local parent = rawget(cls, "__parent") | ||
1129 | if parent then | ||
1130 | return parent[name] | ||
1131 | end | ||
1132 | else | ||
1133 | return val | ||
1134 | end | ||
1135 | end, | ||
1136 | __call = function(cls, ...) | ||
1137 | local _self_0 = setmetatable({ }, _base_0) | ||
1138 | cls.__init(_self_0, ...) | ||
1139 | return _self_0 | ||
1140 | end | ||
1141 | }) | ||
1142 | _base_0.__class = _class_0 | ||
1143 | if _parent_0.__inherited then | ||
1144 | _parent_0.__inherited(_parent_0, _class_0) | ||
1145 | end | ||
1146 | end | ||
1147 | local _u7c7bA | ||
1148 | do | ||
1149 | local _class_0 | ||
1150 | local _base_0 = { } | ||
1151 | local _list_0 = { | ||
1152 | _u7c7bB, | ||
1153 | _u7c7bC, | ||
1154 | _u7c7bD, | ||
1155 | { | ||
1156 | ["值"] = 123 | ||
1157 | } | ||
1158 | } | ||
1159 | for _index_0 = 1, #_list_0 do | ||
1160 | local _item_0 = _list_0[_index_0] | ||
1161 | local _cls_0, _mixin_0 = (_item_0.__base ~= nil), _item_0.__base or _item_0 | ||
1162 | for _key_0, _val_0 in pairs(_mixin_0) do | ||
1163 | if _base_0[_key_0] == nil and (not _cls_0 or not _key_0:match("^__")) then | ||
1164 | _base_0[_key_0] = _val_0 | ||
1165 | end | ||
1166 | end | ||
1167 | end | ||
1168 | if _base_0.__index == nil then | ||
1169 | _base_0.__index = _base_0 | ||
1170 | end | ||
1171 | _class_0 = setmetatable({ | ||
1172 | __init = function() end, | ||
1173 | __base = _base_0, | ||
1174 | __name = "类A" | ||
1175 | }, { | ||
1176 | __index = _base_0, | ||
1177 | __call = function(cls, ...) | ||
1178 | local _self_0 = setmetatable({ }, _base_0) | ||
1179 | cls.__init(_self_0, ...) | ||
1180 | return _self_0 | ||
1181 | end | ||
1182 | }) | ||
1183 | _base_0.__class = _class_0 | ||
1184 | _u7c7bA = _class_0 | ||
1185 | end | ||
1186 | local _u793a_u4f8b | ||
1187 | do | ||
1188 | local _class_0 | ||
1189 | local _base_0 = { } | ||
1190 | if _base_0.__index == nil then | ||
1191 | _base_0.__index = _base_0 | ||
1192 | end | ||
1193 | _class_0 = setmetatable({ | ||
1194 | __init = function() end, | ||
1195 | __base = _base_0, | ||
1196 | __name = "示例" | ||
1197 | }, { | ||
1198 | __index = _base_0, | ||
1199 | __call = function(cls, ...) | ||
1200 | local _self_0 = setmetatable({ }, _base_0) | ||
1201 | cls.__init(_self_0, ...) | ||
1202 | return _self_0 | ||
1203 | end | ||
1204 | }) | ||
1205 | _base_0.__class = _class_0 | ||
1206 | local self = _class_0; | ||
1207 | self["字段1"] = 1 | ||
1208 | self["字段2"] = self["字段1"] + 1 | ||
1209 | _u793a_u4f8b = _class_0 | ||
1210 | end | ||
1211 | local _u968f_u4fbf | ||
1212 | do | ||
1213 | local _class_0 | ||
1214 | local _base_0 = { | ||
1215 | __mul = function(self, _u53c2_u6570y) | ||
1216 | return self["x字段"] * _u53c2_u6570y | ||
1217 | end, | ||
1218 | ["任意名称"] = 123, | ||
1219 | ["相加"] = _u76f8_u52a0, | ||
1220 | __add = add | ||
1221 | } | ||
1222 | if _base_0.__index == nil then | ||
1223 | _base_0.__index = _base_0 | ||
1224 | end | ||
1225 | _class_0 = setmetatable({ | ||
1226 | __init = function(self, _u53c2_u6570) | ||
1227 | self["x字段"] = _u53c2_u6570 | ||
1228 | end, | ||
1229 | __base = _base_0, | ||
1230 | __name = "随便" | ||
1231 | }, { | ||
1232 | __index = _base_0, | ||
1233 | __call = function(cls, ...) | ||
1234 | local _self_0 = setmetatable({ }, _base_0) | ||
1235 | cls.__init(_self_0, ...) | ||
1236 | return _self_0 | ||
1237 | end | ||
1238 | }) | ||
1239 | _base_0.__class = _class_0 | ||
1240 | _u968f_u4fbf = _class_0 | ||
1241 | end | ||
1242 | return nil | ||
diff --git a/spec/outputs/unicode/comprehension.lua b/spec/outputs/unicode/comprehension.lua new file mode 100644 index 0000000..60e490f --- /dev/null +++ b/spec/outputs/unicode/comprehension.lua | |||
@@ -0,0 +1,276 @@ | |||
1 | local _u5217_u8868 = { | ||
2 | 1, | ||
3 | 2, | ||
4 | 3, | ||
5 | 4, | ||
6 | 5, | ||
7 | 6 | ||
8 | } | ||
9 | local _u8f93_u51fa | ||
10 | do | ||
11 | local _tbl_0 = { } | ||
12 | for _u5143_u7d20 in _u5bf9_u8c61_u6570_u7ec4 do | ||
13 | _tbl_0[_u5143_u7d20] = _u5143_u7d20 * 2 | ||
14 | end | ||
15 | _u8f93_u51fa = _tbl_0 | ||
16 | end | ||
17 | local _u5b57_u5178x = { | ||
18 | ["你好"] = "世界", | ||
19 | ["好吧"] = 2323 | ||
20 | } | ||
21 | local _u590d_u5236 | ||
22 | do | ||
23 | local _tbl_0 = { } | ||
24 | for _u952e, _u503c in pairs(_u5bf9_u8c61x) do | ||
25 | if _u952e ~= "好吧" then | ||
26 | _tbl_0[_u952e] = _u503c | ||
27 | end | ||
28 | end | ||
29 | _u590d_u5236 = _tbl_0 | ||
30 | end | ||
31 | local __u65e0_u6548_u53d8_u91cf | ||
32 | do | ||
33 | local _tbl_0 = { } | ||
34 | for _u5143_u7d20 in _u662f_u7684 do | ||
35 | local _key_0, _val_0 = _u89e3_u5305(_u5143_u7d20) | ||
36 | _tbl_0[_key_0] = _val_0 | ||
37 | end | ||
38 | __u65e0_u6548_u53d8_u91cf = _tbl_0 | ||
39 | end | ||
40 | do | ||
41 | local _tbl_0 = { } | ||
42 | local _list_0 = _u662f_u7684 | ||
43 | for _index_0 = 1, #_list_0 do | ||
44 | local _u5143_u7d20 = _list_0[_index_0] | ||
45 | local _key_0, _val_0 = _u89e3_u5305(_u5143_u7d20) | ||
46 | _tbl_0[_key_0] = _val_0 | ||
47 | end | ||
48 | __u65e0_u6548_u53d8_u91cf = _tbl_0 | ||
49 | end | ||
50 | do | ||
51 | local _tbl_0 = { } | ||
52 | for _u5143_u7d20 in _u662f_u7684 do | ||
53 | local _key_0, _val_0 = _u5143_u7d20_u5143_u7d20 | ||
54 | _tbl_0[_key_0] = _val_0 | ||
55 | end | ||
56 | __u65e0_u6548_u53d8_u91cf = _tbl_0 | ||
57 | end | ||
58 | do | ||
59 | local _tbl_0 = { } | ||
60 | local _list_0 = { | ||
61 | { | ||
62 | 1, | ||
63 | 2 | ||
64 | }, | ||
65 | { | ||
66 | 3, | ||
67 | 4 | ||
68 | } | ||
69 | } | ||
70 | for _index_0 = 1, #_list_0 do | ||
71 | local x_u5bf9_u8c61 = _list_0[_index_0] | ||
72 | local _key_0, _val_0 = _u89e3_u5305((function() | ||
73 | local _accum_0 = { } | ||
74 | local _len_0 = 1 | ||
75 | for _u8ba1_u6570, _u5bf9_u8c61 in ipairs(x_u5bf9_u8c61) do | ||
76 | _accum_0[_len_0] = _u5bf9_u8c61 * _u8ba1_u6570 | ||
77 | _len_0 = _len_0 + 1 | ||
78 | end | ||
79 | return _accum_0 | ||
80 | end)()) | ||
81 | _tbl_0[_key_0] = _val_0 | ||
82 | end | ||
83 | __u65e0_u6548_u53d8_u91cf = _tbl_0 | ||
84 | end | ||
85 | local _u53d8_u91cf1 | ||
86 | do | ||
87 | local _accum_0 = { } | ||
88 | local _len_0 = 1 | ||
89 | for _u8ba1_u6570 = 1, 10 do | ||
90 | _accum_0[_len_0] = _u8ba1_u6570 | ||
91 | _len_0 = _len_0 + 1 | ||
92 | end | ||
93 | _u53d8_u91cf1 = _accum_0 | ||
94 | end | ||
95 | local _u53d8_u91cf2 | ||
96 | do | ||
97 | local _accum_0 = { } | ||
98 | local _len_0 = 1 | ||
99 | for _u8ba1_u6570 = 1, 10 do | ||
100 | if _u8ba1_u6570 % 2 == 1 then | ||
101 | _accum_0[_len_0] = _u8ba1_u6570 | ||
102 | _len_0 = _len_0 + 1 | ||
103 | end | ||
104 | end | ||
105 | _u53d8_u91cf2 = _accum_0 | ||
106 | end | ||
107 | local _u53d8_u91cfaa | ||
108 | do | ||
109 | local _accum_0 = { } | ||
110 | local _len_0 = 1 | ||
111 | for _u8ba1_u6570x = 1, 10 do | ||
112 | for _u8ba1_u6570y = 5, 14 do | ||
113 | _accum_0[_len_0] = { | ||
114 | _u8ba1_u6570x, | ||
115 | _u8ba1_u6570y | ||
116 | } | ||
117 | _len_0 = _len_0 + 1 | ||
118 | end | ||
119 | end | ||
120 | _u53d8_u91cfaa = _accum_0 | ||
121 | end | ||
122 | local _u53d8_u91cfbb | ||
123 | do | ||
124 | local _accum_0 = { } | ||
125 | local _len_0 = 1 | ||
126 | for _u5143_u7d20 in _u5bf9_u8c61y do | ||
127 | for _u8ba1_u6570i = 1, 10 do | ||
128 | _accum_0[_len_0] = _u5bf9_u8c61y | ||
129 | _len_0 = _len_0 + 1 | ||
130 | end | ||
131 | end | ||
132 | _u53d8_u91cfbb = _accum_0 | ||
133 | end | ||
134 | local _u53d8_u91cfcc | ||
135 | do | ||
136 | local _accum_0 = { } | ||
137 | local _len_0 = 1 | ||
138 | for _u8ba1_u6570 = 1, 10 do | ||
139 | for _u5143_u7d20 in _u5bf9_u8c61y do | ||
140 | _accum_0[_len_0] = _u5bf9_u8c61y | ||
141 | _len_0 = _len_0 + 1 | ||
142 | end | ||
143 | end | ||
144 | _u53d8_u91cfcc = _accum_0 | ||
145 | end | ||
146 | local _u53d8_u91cfdd | ||
147 | do | ||
148 | local _accum_0 = { } | ||
149 | local _len_0 = 1 | ||
150 | for _u8ba1_u6570 = 1, 10 do | ||
151 | if _u9177 then | ||
152 | for _u5143_u7d20 in _u5bf9_u8c61y do | ||
153 | if _u53d8_u91cfx > 3 then | ||
154 | if _u53d8_u91cfc + 3 then | ||
155 | _accum_0[_len_0] = _u5bf9_u8c61y | ||
156 | _len_0 = _len_0 + 1 | ||
157 | end | ||
158 | end | ||
159 | end | ||
160 | end | ||
161 | end | ||
162 | _u53d8_u91cfdd = _accum_0 | ||
163 | end | ||
164 | do | ||
165 | local _tbl_0 = { } | ||
166 | for _u8ba1_u6570 = 1, 10 do | ||
167 | _tbl_0["你好"] = "世界" | ||
168 | end | ||
169 | __u65e0_u6548_u53d8_u91cf = _tbl_0 | ||
170 | end | ||
171 | local _u53d8_u91cfj | ||
172 | do | ||
173 | local _accum_0 = { } | ||
174 | local _len_0 = 1 | ||
175 | for _des_0 in _u5f88_u591a_u4e1c_u897f do | ||
176 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] | ||
177 | _accum_0[_len_0] = _u5143_u7d20a | ||
178 | _len_0 = _len_0 + 1 | ||
179 | end | ||
180 | _u53d8_u91cfj = _accum_0 | ||
181 | end | ||
182 | local _u53d8_u91cfk | ||
183 | do | ||
184 | local _accum_0 = { } | ||
185 | local _len_0 = 1 | ||
186 | local _list_0 = _u5f88_u591a_u4e1c_u897f | ||
187 | for _index_0 = 1, #_list_0 do | ||
188 | local _des_0 = _list_0[_index_0] | ||
189 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] | ||
190 | _accum_0[_len_0] = _u5143_u7d20a | ||
191 | _len_0 = _len_0 + 1 | ||
192 | end | ||
193 | _u53d8_u91cfk = _accum_0 | ||
194 | end | ||
195 | local _u53d8_u91cfi | ||
196 | do | ||
197 | local _accum_0 = { } | ||
198 | local _len_0 = 1 | ||
199 | local _list_0 = _u5f88_u591a_u4e1c_u897f | ||
200 | for _index_0 = 1, #_list_0 do | ||
201 | local _des_0 = _list_0[_index_0] | ||
202 | local _u4f60_u597d, _u4e16_u754c = _des_0["你好"], _des_0["世界"] | ||
203 | _accum_0[_len_0] = _u4f60_u597d | ||
204 | _len_0 = _len_0 + 1 | ||
205 | end | ||
206 | _u53d8_u91cfi = _accum_0 | ||
207 | end | ||
208 | local _u53d8_u91cfhj | ||
209 | do | ||
210 | local _tbl_0 = { } | ||
211 | for _des_0 in _u5f88_u591a_u4e1c_u897f do | ||
212 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] | ||
213 | _tbl_0[_u5143_u7d20a] = _u5143_u7d20c | ||
214 | end | ||
215 | _u53d8_u91cfhj = _tbl_0 | ||
216 | end | ||
217 | local _u53d8_u91cfhk | ||
218 | do | ||
219 | local _tbl_0 = { } | ||
220 | local _list_0 = _u5f88_u591a_u4e1c_u897f | ||
221 | for _index_0 = 1, #_list_0 do | ||
222 | local _des_0 = _list_0[_index_0] | ||
223 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] | ||
224 | _tbl_0[_u5143_u7d20a] = _u5143_u7d20c | ||
225 | end | ||
226 | _u53d8_u91cfhk = _tbl_0 | ||
227 | end | ||
228 | local _u53d8_u91cfhi | ||
229 | do | ||
230 | local _tbl_0 = { } | ||
231 | local _list_0 = _u5f88_u591a_u4e1c_u897f | ||
232 | for _index_0 = 1, #_list_0 do | ||
233 | local _des_0 = _list_0[_index_0] | ||
234 | local _u4f60_u597d, _u4e16_u754c = _des_0["你好"], _des_0["世界"] | ||
235 | _tbl_0[_u4f60_u597d] = _u4e16_u754c | ||
236 | end | ||
237 | _u53d8_u91cfhi = _tbl_0 | ||
238 | end | ||
239 | for _des_0 in _u5f88_u591a_u4e1c_u897f do | ||
240 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _des_0[1], _des_0[2], _des_0[3] | ||
241 | _u6ca1_u9519(_u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c) | ||
242 | end | ||
243 | do | ||
244 | local _accum_0 = { } | ||
245 | local _len_0 = 1 | ||
246 | local _max_0 = 3 + 4 | ||
247 | for _index_0 = 1 + 2, _max_0 < 0 and #_u5217_u8868 + _max_0 or _max_0 do | ||
248 | local _u9879_u76ee = _u5217_u8868[_index_0] | ||
249 | _accum_0[_len_0] = _u9879_u76ee | ||
250 | _len_0 = _len_0 + 1 | ||
251 | end | ||
252 | __u65e0_u6548_u53d8_u91cf = _accum_0 | ||
253 | end | ||
254 | do | ||
255 | local _accum_0 = { } | ||
256 | local _len_0 = 1 | ||
257 | local _max_0 = 2 - _u4e1c_u897f[4] | ||
258 | for _index_0 = _u4f60_u597d() * 4, _max_0 < 0 and #_u5217_u8868 + _max_0 or _max_0 do | ||
259 | local _u9879_u76ee = _u5217_u8868[_index_0] | ||
260 | _accum_0[_len_0] = _u9879_u76ee | ||
261 | _len_0 = _len_0 + 1 | ||
262 | end | ||
263 | __u65e0_u6548_u53d8_u91cf = _accum_0 | ||
264 | end | ||
265 | do | ||
266 | local _accum_0 = { } | ||
267 | local _len_0 = 1 | ||
268 | for _u9879_u76ee in _u5217_u8868 do | ||
269 | if _u9879_u76ee ~= nil then | ||
270 | _accum_0[_len_0] = _u9879_u76ee["调用"](_u9879_u76ee, 123) | ||
271 | end | ||
272 | _len_0 = _len_0 + 1 | ||
273 | end | ||
274 | _u5217_u8868 = _accum_0 | ||
275 | end | ||
276 | return nil | ||
diff --git a/spec/outputs/unicode/cond.lua b/spec/outputs/unicode/cond.lua new file mode 100644 index 0000000..f972dea --- /dev/null +++ b/spec/outputs/unicode/cond.lua | |||
@@ -0,0 +1,354 @@ | |||
1 | local _u4f60_u5f88_u9177 = false | ||
2 | local __u65e0_u6548_u53d8_u91cf | ||
3 | if _u9177 then | ||
4 | if _u4f60_u5f88_u9177 then | ||
5 | __u65e0_u6548_u53d8_u91cf = _u4e00 | ||
6 | else | ||
7 | if _u5403_u4e1c_u897f then | ||
8 | __u65e0_u6548_u53d8_u91cf = _u597d | ||
9 | else | ||
10 | __u65e0_u6548_u53d8_u91cf = _u4e8c | ||
11 | __u65e0_u6548_u53d8_u91cf = _u4e09 | ||
12 | end | ||
13 | end | ||
14 | else | ||
15 | __u65e0_u6548_u53d8_u91cf = _u5426 | ||
16 | end | ||
17 | if _u9177 then | ||
18 | __u65e0_u6548_u53d8_u91cf = _u5426 | ||
19 | end | ||
20 | if _u9177 then | ||
21 | __u65e0_u6548_u53d8_u91cf = _u5426 | ||
22 | else | ||
23 | __u65e0_u6548_u53d8_u91cf = _u662f | ||
24 | end | ||
25 | if _u9177 then | ||
26 | _u5594(_u9177) | ||
27 | else | ||
28 | _u6ca1_u90a3_u4e48(_u9177) | ||
29 | end | ||
30 | if _u5728_u5de5_u4f5c then | ||
31 | if _u9177 then | ||
32 | if _u9177 then | ||
33 | __u65e0_u6548_u53d8_u91cf = _u597d_u5427 | ||
34 | else | ||
35 | __u65e0_u6548_u53d8_u91cf = _u4ec0_u4e48 | ||
36 | end | ||
37 | else | ||
38 | __u65e0_u6548_u53d8_u91cf = _u5450 | ||
39 | end | ||
40 | end | ||
41 | if _u270c_ufe0f then | ||
42 | _u65e0(_u65e5) | ||
43 | elseif _u9177(_u6211) then | ||
44 | _u597d_u5427(_u5440) | ||
45 | else | ||
46 | u_u578b(_u8def) | ||
47 | end | ||
48 | if _u270c_ufe0f then | ||
49 | _u65e0(_u7236) | ||
50 | else | ||
51 | if _u9177(_u4f60) then | ||
52 | _u597d_u5427(_u5427) | ||
53 | else | ||
54 | p_u578b(_u8def) | ||
55 | end | ||
56 | end | ||
57 | if (function() end)() then | ||
58 | _u968f_u4fbf(_u600e_u6837) | ||
59 | end | ||
60 | if nil then | ||
61 | _u7ffb_u8f6c(_u6211) | ||
62 | else | ||
63 | _u8fd9_u4e2a(_u662f, _u5f27_u5ea6) | ||
64 | end | ||
65 | if _u4e1c_u897f(_u4e0d_u9519) then | ||
66 | _u6ca1(_u6cd5) | ||
67 | elseif _u597d_u7684(_u786e_u5b9a) then | ||
68 | _u4ec0_u4e48(_u8fd9_u91cc) | ||
69 | end | ||
70 | if _u5f88_u591a_u4e1c_u897f then | ||
71 | _u6ca1(_u673a_u4f1a) | ||
72 | elseif _u597d_u5427 then | ||
73 | _u73b0_u5728(_u600e_u4e48_u529e) | ||
74 | end | ||
75 | if _u5f88_u591a_u4e1c_u897f then | ||
76 | _u662f(_u4f19_u8ba1) | ||
77 | elseif _u597d_u7684(_u4eba) then | ||
78 | _u55e8(_u597d_u5440) | ||
79 | else | ||
80 | _u55ef(_u786e_u5b9a) | ||
81 | end | ||
82 | if _u6211_u4eec(_u8d70_u5427) then | ||
83 | _u6253_u5370("打招呼") | ||
84 | elseif "只有我们" then | ||
85 | _u6253_u5370("威尔史密斯") | ||
86 | else | ||
87 | _u663e_u793a(5555555) | ||
88 | end | ||
89 | do | ||
90 | local _u67d0_u4e1c_u897f = 10 | ||
91 | if _u67d0_u4e1c_u897f then | ||
92 | _u6253_u5370(_u67d0_u4e1c_u897f) | ||
93 | else | ||
94 | _u6253_u5370("其它") | ||
95 | end | ||
96 | end | ||
97 | local _u4f60_u597d | ||
98 | do | ||
99 | local _u67d0_u4e1c_u897f = 10 | ||
100 | if _u67d0_u4e1c_u897f then | ||
101 | _u4f60_u597d = _u6253_u5370(_u67d0_u4e1c_u897f) | ||
102 | else | ||
103 | _u4f60_u597d = _u6253_u5370("其它") | ||
104 | end | ||
105 | end | ||
106 | _u4f60_u597d = 5 + (function() | ||
107 | local _u67d0_u4e1c_u897f = 10 | ||
108 | if _u67d0_u4e1c_u897f then | ||
109 | return _u6253_u5370(_u67d0_u4e1c_u897f) | ||
110 | end | ||
111 | end)() | ||
112 | local z_u53d8_u91cf = false | ||
113 | if false then | ||
114 | __u65e0_u6548_u53d8_u91cf = _u4e00 | ||
115 | else | ||
116 | do | ||
117 | local _u6761_u4ef6x = true | ||
118 | if _u6761_u4ef6x then | ||
119 | __u65e0_u6548_u53d8_u91cf = _u4e8c | ||
120 | else | ||
121 | do | ||
122 | local _u6761_u4ef6z = true | ||
123 | if _u6761_u4ef6z then | ||
124 | __u65e0_u6548_u53d8_u91cf = _u4e09 | ||
125 | else | ||
126 | __u65e0_u6548_u53d8_u91cf = _u56db | ||
127 | end | ||
128 | end | ||
129 | end | ||
130 | end | ||
131 | end | ||
132 | local _u8f93_u51fa | ||
133 | if false then | ||
134 | _u8f93_u51fa = _u4e00 | ||
135 | else | ||
136 | do | ||
137 | local _u6761_u4ef6x = true | ||
138 | if _u6761_u4ef6x then | ||
139 | _u8f93_u51fa = _u4e8c | ||
140 | else | ||
141 | do | ||
142 | local _u6761_u4ef6z = true | ||
143 | if _u6761_u4ef6z then | ||
144 | _u8f93_u51fa = _u4e09 | ||
145 | else | ||
146 | _u8f93_u51fa = _u56db | ||
147 | end | ||
148 | end | ||
149 | end | ||
150 | end | ||
151 | end | ||
152 | local _u53d8_u91cf | ||
153 | _u53d8_u91cf = function() | ||
154 | do | ||
155 | local _u67d0_u4e1c_u897f = true | ||
156 | if _u67d0_u4e1c_u897f then | ||
157 | return 1 | ||
158 | else | ||
159 | do | ||
160 | local _u53e6_u4e00_u4e2a = false | ||
161 | if _u53e6_u4e00_u4e2a then | ||
162 | return 2 | ||
163 | end | ||
164 | end | ||
165 | end | ||
166 | end | ||
167 | end | ||
168 | if not true then | ||
169 | _u6253_u5370("酷!") | ||
170 | end | ||
171 | if not (true and false) then | ||
172 | _u6253_u5370("酷!") | ||
173 | end | ||
174 | if not false then | ||
175 | _u6253_u5370("酷!") | ||
176 | end | ||
177 | if not false then | ||
178 | _u6253_u5370("酷!") | ||
179 | else | ||
180 | _u6253_u5370("no way!") | ||
181 | end | ||
182 | if not nil then | ||
183 | _u6253_u5370("hello") | ||
184 | else | ||
185 | _u6253_u5370("world") | ||
186 | end | ||
187 | local x | ||
188 | if not true then | ||
189 | x = _u6253_u5370("酷!") | ||
190 | end | ||
191 | if not (true and false) then | ||
192 | x = _u6253_u5370("酷!") | ||
193 | end | ||
194 | local y | ||
195 | if not false then | ||
196 | y = _u6253_u5370("酷!") | ||
197 | end | ||
198 | if not false then | ||
199 | y = _u6253_u5370("酷!") | ||
200 | else | ||
201 | y = _u6253_u5370("没门!") | ||
202 | end | ||
203 | local z | ||
204 | if not nil then | ||
205 | z = _u6253_u5370("你好") | ||
206 | else | ||
207 | z = _u6253_u5370("世界") | ||
208 | end | ||
209 | _u6253_u5370((function() | ||
210 | if not true then | ||
211 | return _u6253_u5370("酷!") | ||
212 | end | ||
213 | end)()) | ||
214 | _u6253_u5370((function() | ||
215 | if not (true and false) then | ||
216 | return _u6253_u5370("酷!") | ||
217 | end | ||
218 | end)()) | ||
219 | _u6253_u5370((function() | ||
220 | if not false then | ||
221 | return _u6253_u5370("酷!") | ||
222 | end | ||
223 | end)()) | ||
224 | _u6253_u5370((function() | ||
225 | if not false then | ||
226 | return _u6253_u5370("酷!") | ||
227 | else | ||
228 | return _u6253_u5370("没门!") | ||
229 | end | ||
230 | end)()) | ||
231 | _u6253_u5370((function() | ||
232 | if not nil then | ||
233 | return _u6253_u5370("你好") | ||
234 | else | ||
235 | return _u6253_u5370("世界") | ||
236 | end | ||
237 | end)()) | ||
238 | if not _u503c then | ||
239 | _u6253_u5370("你好") | ||
240 | end | ||
241 | local _u53d8_u91cfdddd | ||
242 | if not _u503c then | ||
243 | _u53d8_u91cfdddd = { | ||
244 | 1, | ||
245 | 2, | ||
246 | 3 | ||
247 | } | ||
248 | end | ||
249 | do | ||
250 | local j_u53d8_u91cf = 100 | ||
251 | j_u53d8_u91cf = _u55e8() | ||
252 | if not j_u53d8_u91cf then | ||
253 | _u9519_u8bef("不是 j变量!") | ||
254 | end | ||
255 | end | ||
256 | local _u53d8_u91cfa = 12 | ||
257 | local _u53d8_u91cfc, _u53d8_u91cfb | ||
258 | if _u67d0_u4e1c_u897f then | ||
259 | _u53d8_u91cfa, _u53d8_u91cfc, _u53d8_u91cfb = "酷", nil, nil | ||
260 | end | ||
261 | local _u53d8_u91cfj | ||
262 | if 1 then | ||
263 | if 2 then | ||
264 | _u53d8_u91cfj = 3 | ||
265 | end | ||
266 | else | ||
267 | _u53d8_u91cfj = 6 | ||
268 | end | ||
269 | local _u53d8_u91cfm | ||
270 | if 1 then | ||
271 | if 2 then | ||
272 | _u53d8_u91cfm = 3 | ||
273 | end | ||
274 | else | ||
275 | _u53d8_u91cfm = 6 | ||
276 | end | ||
277 | do | ||
278 | _u51fd_u6570a({ | ||
279 | ["字段b"] = _u5b57_u6bb5b | ||
280 | }) | ||
281 | if _u51fd_u6570a then | ||
282 | return { | ||
283 | ["字段b"] = _u5b57_u6bb5b | ||
284 | } | ||
285 | else | ||
286 | if _u51fd_u6570c then | ||
287 | return { | ||
288 | ["字段d"] = _u53d8_u91cfe | ||
289 | } | ||
290 | else | ||
291 | return { | ||
292 | ["字段f"] = 123 | ||
293 | } | ||
294 | end | ||
295 | end | ||
296 | end | ||
297 | do | ||
298 | _u51fd_u6570c({ | ||
299 | ["字段d"] = _u53d8_u91cfe | ||
300 | }) | ||
301 | if _u6761_u4ef6a then | ||
302 | local _u5b57_u6bb5b = _u53d8_u91cftb["字段b"] | ||
303 | elseif _u6761_u4ef6c then | ||
304 | local _u53d8_u91cfe = _u53d8_u91cftb["字段d"] | ||
305 | end | ||
306 | end | ||
307 | do | ||
308 | local _des_0 = _u6570_u5b66_u5e93 | ||
309 | if _des_0 then | ||
310 | local _u6d3e = _des_0["派"] | ||
311 | _u6253_u5370(_u6d3e) | ||
312 | end | ||
313 | end | ||
314 | do | ||
315 | local _u6570_u5b66_u5e93 | ||
316 | if _u6570_u5b66_u5e93 then | ||
317 | local _u6d3e = _u6570_u5b66_u5e93["派"] | ||
318 | _u6253_u5370(_u6d3e) | ||
319 | end | ||
320 | end | ||
321 | do | ||
322 | do | ||
323 | local __u6a21_u5757 = { } | ||
324 | if __u6a21_u5757 then | ||
325 | local _u4e1c_u897f = __u6a21_u5757["东西"] | ||
326 | local a_u529f_u80fd, b_u529f_u80fd = __u6a21_u5757["a功能"], __u6a21_u5757["b功能"] | ||
327 | end | ||
328 | end | ||
329 | end | ||
330 | do | ||
331 | do | ||
332 | local _des_0 = { } | ||
333 | if _des_0 then | ||
334 | __u6a21_u5757 = _des_0 | ||
335 | local _u4e1c_u897f = __u6a21_u5757["东西"] | ||
336 | local a_u529f_u80fd, b_u529f_u80fd | ||
337 | do | ||
338 | local _obj_0 = __u6a21_u5757 | ||
339 | a_u529f_u80fd, b_u529f_u80fd = _obj_0["a功能"], _obj_0["b功能"] | ||
340 | end | ||
341 | end | ||
342 | end | ||
343 | end | ||
344 | do | ||
345 | local _u53d8_u91cfv | ||
346 | if 1 and (function() | ||
347 | return 0 ~= 1 | ||
348 | end)() then | ||
349 | _u53d8_u91cfv = 1 | ||
350 | else | ||
351 | _u53d8_u91cfv = 2 | ||
352 | end | ||
353 | end | ||
354 | return nil | ||
diff --git a/spec/outputs/unicode/destructure.lua b/spec/outputs/unicode/destructure.lua new file mode 100644 index 0000000..002c4b0 --- /dev/null +++ b/spec/outputs/unicode/destructure.lua | |||
@@ -0,0 +1,637 @@ | |||
1 | do | ||
2 | local _u5143_u7d20a, _u5143_u7d20b | ||
3 | do | ||
4 | local _obj_0 = _u4f60_u597d | ||
5 | _u5143_u7d20a, _u5143_u7d20b = _obj_0[1], _obj_0[2] | ||
6 | end | ||
7 | local _u5143_u7d20c | ||
8 | do | ||
9 | local _obj_0 = _u4f60_u597d | ||
10 | _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _obj_0[1][1], _obj_0[2], _obj_0[3][1] | ||
11 | end | ||
12 | local _u4f60_u597d, _u4e16_u754c | ||
13 | do | ||
14 | local _obj_0 = _u503c | ||
15 | _u4f60_u597d, _u4e16_u754c = _obj_0["你好"], _obj_0["世界"] | ||
16 | end | ||
17 | end | ||
18 | do | ||
19 | local _u5426, _u4e1c_u897f | ||
20 | do | ||
21 | local _obj_0 = _u4e16_u754c | ||
22 | _u5426, _u4e1c_u897f = _obj_0["是"], _obj_0[1] | ||
23 | end | ||
24 | local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c, d_u5b57_u6bb5 | ||
25 | do | ||
26 | local _obj_0 = _u597d | ||
27 | _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c, d_u5b57_u6bb5 = _obj_0["字段a"], _obj_0["字段b"], _obj_0["字段c"], _obj_0["d字段"] | ||
28 | end | ||
29 | local _u53d8_u91cfb = _u4e8c | ||
30 | local a_u5143_u7d20 = _u4e00[1] | ||
31 | local _u53d8_u91cfc = nil | ||
32 | local b_u5143_u7d20 = _u4e00[1] | ||
33 | local _u53d8_u91cfe = _u4e8c | ||
34 | local d_u5143_u7d20 = _u4e00[1] | ||
35 | local _u53d8_u91cfx = _u4e00 | ||
36 | local _u5143_u7d20y = _u4e8c[1] | ||
37 | local _u53d8_u91cfxx, _u53d8_u91cfyy = 1, 2 | ||
38 | local _u5143_u7d20yy, _u5143_u7d20xx | ||
39 | do | ||
40 | local _obj_0 = { | ||
41 | _u53d8_u91cfxx, | ||
42 | _u53d8_u91cfyy | ||
43 | } | ||
44 | _u5143_u7d20yy, _u5143_u7d20xx = _obj_0[1], _obj_0[2] | ||
45 | end | ||
46 | local _u5143_u7d20a, _u5143_u7d20c, _u5b57_u6bb5d, _u5143_u7d20e, _u5b57_u6bb5f, _u5143_u7d20g | ||
47 | do | ||
48 | local _obj_0 = _u8868 | ||
49 | _u5143_u7d20a, _u5b57_u6bb5b, _u5143_u7d20c, _u5b57_u6bb5d, _u5143_u7d20e, _u5b57_u6bb5f, _u5143_u7d20g = _obj_0[1], _obj_0["字段b"], _obj_0[2], _obj_0["字段d"], _obj_0[3], _obj_0["字段f"], _obj_0[4] | ||
50 | end | ||
51 | do | ||
52 | _u53d8_u91cfc = nil | ||
53 | do | ||
54 | local _obj_0 = _u8868 | ||
55 | _u5b57_u6bb5a, _u5b57_u6bb5b = _obj_0["字段a"], _obj_0["字段b"] | ||
56 | end | ||
57 | end | ||
58 | do | ||
59 | local _u53d8_u91cfa = _u8868 | ||
60 | do | ||
61 | local _obj_0 = __u65e0_u6548_u53d8_u91cf | ||
62 | _u5b57_u6bb5b, _u5b57_u6bb5c = _obj_0["字段b"], _obj_0["字段c"] | ||
63 | end | ||
64 | end | ||
65 | do | ||
66 | _u53d8_u91cfb = __u65e0_u6548_u53d8_u91cf | ||
67 | _u5b57_u6bb5a = _u8868["字段a"] | ||
68 | _u5b57_u6bb5c = __u65e0_u6548_u53d8_u91cf["字段c"] | ||
69 | end | ||
70 | end | ||
71 | do | ||
72 | local _u672a_u6765_u4eba_u4eec = { | ||
73 | ["雕刻家"] = "翁贝托·博乔尼", | ||
74 | ["画家"] = "弗拉基米尔·伯留克", | ||
75 | ["诗人"] = { | ||
76 | ["姓名"] = "F.T.马里内蒂", | ||
77 | ["地址"] = { | ||
78 | "罗马42R大街", | ||
79 | "贝拉焦,意大利 22021" | ||
80 | } | ||
81 | } | ||
82 | } | ||
83 | do | ||
84 | local _u59d3_u540d, _u8857_u9053, _u57ce_u5e02 = _u672a_u6765_u4eba_u4eec["诗人"]["姓名"], _u672a_u6765_u4eba_u4eec["诗人"]["地址"][1], _u672a_u6765_u4eba_u4eec["诗人"]["地址"][2] | ||
85 | end | ||
86 | do | ||
87 | local _u96d5_u523b_u5bb6, _u753b_u5bb6, _u59d3_u540d, _u8857_u9053, _u57ce_u5e02 = _u672a_u6765_u4eba_u4eec["雕刻家"], _u672a_u6765_u4eba_u4eec["画家"], _u672a_u6765_u4eba_u4eec["诗人"]["姓名"], _u672a_u6765_u4eba_u4eec["诗人"]["地址"][1], _u672a_u6765_u4eba_u4eec["诗人"]["地址"][2] | ||
88 | end | ||
89 | end | ||
90 | do | ||
91 | local _u53d8_u91cfc, _u53d8_u91cfe | ||
92 | do | ||
93 | local _obj_0 = _u5bf9_u8c61tb | ||
94 | _u53d8_u91cfc, _u53d8_u91cfe = _obj_0["字段a"]["字段b"], _obj_0["字段a"]["字段d"] | ||
95 | end | ||
96 | end | ||
97 | do | ||
98 | local _u53d8_u91cfc, _u53d8_u91cfe, _u5143_u7d20f | ||
99 | do | ||
100 | local _obj_0 = _u5bf9_u8c61tb | ||
101 | _u53d8_u91cfc, _u53d8_u91cfe, _u5143_u7d20f = _obj_0["字段a"][1]["字段b"], _obj_0["字段a"][2]["字段d"], _obj_0["字段a"][3] | ||
102 | end | ||
103 | end | ||
104 | do | ||
105 | self["世界"] = _u53d8_u91cfx[1] | ||
106 | do | ||
107 | local _obj_0 = _u53d8_u91cfx | ||
108 | _u5bf9_u8c61a["字段b"], _u5bf9_u8c61c["字段y"], _u51fd_u6570()["字段z"] = _obj_0[1], _obj_0[2], _obj_0[3] | ||
109 | end | ||
110 | self["世界"] = _u53d8_u91cfx["世界"] | ||
111 | end | ||
112 | do | ||
113 | local _u4e1c_u897f = { | ||
114 | { | ||
115 | 1, | ||
116 | 2 | ||
117 | }, | ||
118 | { | ||
119 | 3, | ||
120 | 4 | ||
121 | } | ||
122 | } | ||
123 | for _index_0 = 1, #_u4e1c_u897f do | ||
124 | local _des_0 = _u4e1c_u897f[_index_0] | ||
125 | local _u5143_u7d20x, _u5143_u7d20y = _des_0[1], _des_0[2] | ||
126 | _u6253_u5370(_u5143_u7d20x, _u5143_u7d20y) | ||
127 | end | ||
128 | end | ||
129 | do | ||
130 | do | ||
131 | local _with_0 = _u4e1c_u897f | ||
132 | local _u5143_u7d20a, _u5143_u7d20b = _with_0[1], _with_0[2] | ||
133 | _u6253_u5370(_u5143_u7d20a, _u5143_u7d20b) | ||
134 | end | ||
135 | end | ||
136 | do | ||
137 | local _u4e1c_u897f = nil | ||
138 | if _u4e1c_u897f then | ||
139 | local _u5143_u7d20a = _u4e1c_u897f[1] | ||
140 | _u6253_u5370(_u5143_u7d20a) | ||
141 | else | ||
142 | _u6253_u5370("没东西") | ||
143 | end | ||
144 | local _u4e1c_u4e1c = { | ||
145 | 1, | ||
146 | 2 | ||
147 | } | ||
148 | if _u4e1c_u4e1c then | ||
149 | local _u5143_u7d20a, _u5143_u7d20b = _u4e1c_u4e1c[1], _u4e1c_u4e1c[2] | ||
150 | _u6253_u5370(_u5143_u7d20a, _u5143_u7d20b) | ||
151 | end | ||
152 | if _u4e1c_u897f then | ||
153 | local _u5143_u7d20a, _u5143_u7d20b = _u4e1c_u897f[1], _u4e1c_u897f[2] | ||
154 | _u6253_u5370(_u5143_u7d20a, _u5143_u7d20b) | ||
155 | else | ||
156 | if _u4e1c_u4e1c then | ||
157 | local _u5143_u7d20c, _u5143_u7d20d = _u4e1c_u4e1c[1], _u4e1c_u4e1c[2] | ||
158 | _u6253_u5370(_u5143_u7d20c, _u5143_u7d20d) | ||
159 | else | ||
160 | _u6253_u5370("不") | ||
161 | end | ||
162 | end | ||
163 | end | ||
164 | do | ||
165 | local _u53d8_u91cfz = "好" | ||
166 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _u53d8_u91cfz[1], _u53d8_u91cfz[2], _u53d8_u91cfz[3] | ||
167 | end | ||
168 | do | ||
169 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c | ||
170 | do | ||
171 | local _obj_0 = _u53d8_u91cfz | ||
172 | _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _obj_0[1], _obj_0[2], _obj_0[3] | ||
173 | end | ||
174 | end | ||
175 | local _ | ||
176 | _ = function(_u53c2_u6570z) | ||
177 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _u53c2_u6570z[1], _u53c2_u6570z[2], _u53c2_u6570z[3] | ||
178 | end | ||
179 | do | ||
180 | local _u53d8_u91cfz = "〇〇" | ||
181 | _ = function(_u53c2_u6570k) | ||
182 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c | ||
183 | do | ||
184 | local _obj_0 = _u53c2_u6570z | ||
185 | _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _obj_0[1], _obj_0[2], _obj_0[3] | ||
186 | end | ||
187 | end | ||
188 | end | ||
189 | do | ||
190 | local _u7ed3_u675f_u53d8_u91cf = _u4e1c_u897f["函数"]["结束"] | ||
191 | end | ||
192 | do | ||
193 | local _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c | ||
194 | do | ||
195 | local _obj_0 = _u4e1c_u897f | ||
196 | _u5143_u7d20a, _u5143_u7d20b, _u5143_u7d20c = _obj_0["如果"][1], _obj_0["如果"][2], _obj_0["如果"][3] | ||
197 | end | ||
198 | end | ||
199 | do | ||
200 | local _u5b57_u6bb5a, _u5b57_u6bb5b | ||
201 | if true then | ||
202 | do | ||
203 | local _obj_0 = { | ||
204 | ["字段a"] = "你好", | ||
205 | ["字段b"] = "世界" | ||
206 | } | ||
207 | _u5b57_u6bb5a, _u5b57_u6bb5b = _obj_0["字段a"], _obj_0["字段b"] | ||
208 | end | ||
209 | end | ||
210 | local _u5929, _u5c0f_u65f6, _u5206_u949f, _u79d2 | ||
211 | do | ||
212 | local _accum_0 = { } | ||
213 | local _len_0 = 1 | ||
214 | local _list_0 = { | ||
215 | string.match("1 2 3 4", "(.+)%s(.+)%s(.+)%s(.+)") | ||
216 | } | ||
217 | for _index_0 = 1, #_list_0 do | ||
218 | local _u5143_u7d20 = _list_0[_index_0] | ||
219 | _accum_0[_len_0] = tonumber(_u5143_u7d20) | ||
220 | _len_0 = _len_0 + 1 | ||
221 | end | ||
222 | _u5929, _u5c0f_u65f6, _u5206_u949f, _u79d2 = _accum_0[1], _accum_0[2], _accum_0[3], _accum_0[4] | ||
223 | end | ||
224 | local _u4e00, _u4e8c, _u4e09 | ||
225 | do | ||
226 | local _tbl_0 = { } | ||
227 | for _u5339_u914d_u7ed3_u679c in (function() | ||
228 | local _call_0 = _u968f_u673a_u5bf9_u8c61 | ||
229 | return _call_0["全局匹配"](_call_0, "%S+") | ||
230 | end)() do | ||
231 | _tbl_0[_u5339_u914d_u7ed3_u679c] = true | ||
232 | end | ||
233 | _u4e00, _u4e8c, _u4e09 = _tbl_0["一"], _tbl_0["二"], _tbl_0["三"] | ||
234 | end | ||
235 | local _u53d8_u91cfb = 123 | ||
236 | _u5b57_u6bb5a = ((function() | ||
237 | local _call_0 = _u5bf9_u8c61a | ||
238 | return _call_0["如果"](_call_0, 123) | ||
239 | end)() + _u53d8_u91cft)["字段a"] | ||
240 | end | ||
241 | do | ||
242 | local _u540d_u79f0, _u5de5_u4f5c | ||
243 | do | ||
244 | local _obj_0 = _u4e2a_u4eba | ||
245 | _u540d_u79f0, _u5de5_u4f5c = _obj_0["名称"], _obj_0["工作"] | ||
246 | if _u540d_u79f0 == nil then | ||
247 | _u540d_u79f0 = "没名字" | ||
248 | end | ||
249 | if _u5de5_u4f5c == nil then | ||
250 | _u5de5_u4f5c = "没工作" | ||
251 | end | ||
252 | end | ||
253 | local _u8bf7_u6c42 | ||
254 | _u8bf7_u6c42 = function(_u5730_u5740, _u9009_u9879) | ||
255 | if _u9009_u9879 == nil then | ||
256 | _u9009_u9879 = { } | ||
257 | end | ||
258 | local _u65b9_u5f0f, _u8bf7_u6c42_u5934, _u53c2_u6570, _u8d1f_u8f7d, _u786e_u8ba4, _u9519_u8bef, _u6700_u7ec8_u5904_u7406 = _u9009_u9879["方式"], _u9009_u9879["请求头"], _u9009_u9879["参数"], _u9009_u9879["负载"], _u9009_u9879["确认"], _u9009_u9879["错误"], _u9009_u9879["最终处理"] | ||
259 | if _u65b9_u5f0f == nil then | ||
260 | _u65b9_u5f0f = "GET" | ||
261 | end | ||
262 | if _u8bf7_u6c42_u5934 == nil then | ||
263 | _u8bf7_u6c42_u5934 = { } | ||
264 | end | ||
265 | if _u53c2_u6570 == nil then | ||
266 | _u53c2_u6570 = { } | ||
267 | end | ||
268 | if _u8d1f_u8f7d == nil then | ||
269 | _u8d1f_u8f7d = "" | ||
270 | end | ||
271 | local _u7ed3_u679c = _u53d1_u8d77_u8bf7_u6c42(_u5730_u5740, _u65b9_u5f0f, _u53c2_u6570, _u8d1f_u8f7d, _u786e_u8ba4, _u9519_u8bef, _u6700_u7ec8_u5904_u7406) | ||
272 | return _u7ed3_u679c | ||
273 | end | ||
274 | local _u503c1, _u952e3 | ||
275 | do | ||
276 | local _obj_0 = _u5bf9_u8c61tb | ||
277 | _u503c1, _u952e3 = _obj_0["键1"]["键2"], _obj_0["键3"] | ||
278 | if _u503c1 == nil then | ||
279 | _u503c1 = 123 | ||
280 | end | ||
281 | if _u952e3 == nil then | ||
282 | _u952e3 = "abc" | ||
283 | end | ||
284 | end | ||
285 | local _u5143_u8868, call, add | ||
286 | do | ||
287 | local _obj_0 = getmetatable(_u5bf9_u8c61tb) | ||
288 | _u5143_u8868, call, add = _obj_0, getmetatable(_obj_0).__call, getmetatable(_obj_0).__add | ||
289 | if _u5143_u8868 == nil then | ||
290 | _u5143_u8868 = { | ||
291 | __index = { | ||
292 | ["字段abc"] = 123 | ||
293 | } | ||
294 | } | ||
295 | end | ||
296 | if call == nil then | ||
297 | call = (function() | ||
298 | return { } | ||
299 | end) | ||
300 | end | ||
301 | end | ||
302 | local _u5143_u8868x, y_u5b57_u6bb5, z_u53d8_u91cf, index | ||
303 | do | ||
304 | local _obj_0 = _u5bf9_u8c61tb | ||
305 | _u5143_u8868x, y_u5b57_u6bb5, z_u53d8_u91cf = getmetatable(_obj_0["字段x"]), _obj_0["y字段"], _obj_0["z字段"] | ||
306 | if _u5143_u8868x == nil then | ||
307 | _u5143_u8868x = { } | ||
308 | end | ||
309 | index = getmetatable(_obj_0).__index | ||
310 | if index == nil then | ||
311 | index = function() | ||
312 | return nil | ||
313 | end | ||
314 | end | ||
315 | end | ||
316 | do | ||
317 | local _tmp_0 | ||
318 | do | ||
319 | local _obj_0 = getmetatable(_u5bf9_u8c61tb) | ||
320 | _tmp_0 = _obj_0["函数"] | ||
321 | end | ||
322 | if _tmp_0 == nil then | ||
323 | do | ||
324 | local _obj_0 = _u9879_u76ee | ||
325 | if _obj_0 ~= nil then | ||
326 | _tmp_0 = _obj_0["默认值"] | ||
327 | end | ||
328 | end | ||
329 | end | ||
330 | a_u5bf9_u8c61["b字段"](function() | ||
331 | return 123 | ||
332 | end)["字段c"] = _tmp_0 | ||
333 | end | ||
334 | end | ||
335 | do | ||
336 | local _u5143_u8868, _u51cf_u51fd_u6570 | ||
337 | do | ||
338 | local _obj_0 = getmetatable(_u5bf9_u8c61tb["字段x"]) | ||
339 | _u5143_u8868, _u51cf_u51fd_u6570 = _obj_0, _obj_0.__sub | ||
340 | if _u5143_u8868 == nil then | ||
341 | _u5143_u8868 = { } | ||
342 | end | ||
343 | end | ||
344 | end | ||
345 | do | ||
346 | local _u5143_u8868, _u51cf_u51fd_u6570 | ||
347 | do | ||
348 | local _obj_0 = _u5bf9_u8c61tb | ||
349 | _u5143_u8868, _u51cf_u51fd_u6570 = getmetatable(_obj_0["x字段"]), getmetatable(_obj_0["x字段"]).__sub | ||
350 | if _u5143_u8868 == nil then | ||
351 | _u5143_u8868 = { } | ||
352 | end | ||
353 | end | ||
354 | end | ||
355 | do | ||
356 | local _u5143_u7d20a, _u5143_u7d20b | ||
357 | do | ||
358 | local _obj_0 = _u5bf9_u8c61tb | ||
359 | local _tmp_0 | ||
360 | _u5143_u7d20a, _u5143_u7d20b, _tmp_0 = _obj_0[1], _obj_0[2], _obj_0["字段c"][1] | ||
361 | if _u5143_u7d20a == nil then | ||
362 | _u5143_u7d20a = 1 | ||
363 | end | ||
364 | if _u5143_u7d20b == nil then | ||
365 | _u5143_u7d20b = 2 | ||
366 | end | ||
367 | if _tmp_0 == nil then | ||
368 | _tmp_0 = 3 | ||
369 | end | ||
370 | _u5bf9_u50cfd["字段e"] = _tmp_0 | ||
371 | end | ||
372 | local _list_0 = _u5143_u7ec4_u5217_u8868 | ||
373 | for _index_0 = 1, #_list_0 do | ||
374 | local _des_0 = _list_0[_index_0] | ||
375 | local _u5de6, _u53f3 = _des_0[1], _des_0[2] | ||
376 | if _u5de6 == nil then | ||
377 | _u5de6 = "null" | ||
378 | end | ||
379 | if _u53f3 == nil then | ||
380 | _u53f3 = false | ||
381 | end | ||
382 | _u6253_u5370(_u5de6, _u53f3) | ||
383 | end | ||
384 | end | ||
385 | do | ||
386 | local a_u5143_u7d20, b_u5143_u7d20 | ||
387 | do | ||
388 | local _obj_0 = _u5bf9_u8c61tb | ||
389 | a_u5143_u7d20, b_u5143_u7d20 = _obj_0[2], _obj_0[4] | ||
390 | end | ||
391 | end | ||
392 | do | ||
393 | do | ||
394 | local _obj_0 = _u5bf9_u8c61x["字段x"]["字段x"] | ||
395 | local _tmp_0, _tmp_1 = _obj_0["字段x"], _obj_0["y字段"] | ||
396 | if _tmp_0 == nil then | ||
397 | _tmp_0 = 1 | ||
398 | end | ||
399 | if _tmp_1 == nil then | ||
400 | _tmp_1 = 2 | ||
401 | end | ||
402 | _u5bf9_u8c61a["字段b"] = _tmp_0 | ||
403 | a_u5bf9_u8c61["c字段"] = _tmp_1 | ||
404 | end | ||
405 | end | ||
406 | do | ||
407 | local _u5bbd, _u9ad8 | ||
408 | do | ||
409 | local _obj_0 = _u89c6_u533a["尺寸"] | ||
410 | _u5bbd, _u9ad8 = _obj_0["宽"], _obj_0["高"] | ||
411 | end | ||
412 | local x_u5750_u6807, y_u5750_u6807 | ||
413 | do | ||
414 | local _obj_0 = _u70b9 | ||
415 | x_u5750_u6807, y_u5750_u6807 = _obj_0["x坐标"], _obj_0["y坐标"] | ||
416 | if x_u5750_u6807 == nil then | ||
417 | x_u5750_u6807 = 0.0 | ||
418 | end | ||
419 | if y_u5750_u6807 == nil then | ||
420 | y_u5750_u6807 = 0.0 | ||
421 | end | ||
422 | end | ||
423 | end | ||
424 | do | ||
425 | local _u53d8_u91cf1, _u53d8_u91cf2, _u53d8_u91cf3, _u53d8_u91cfd, _u53d8_u91cfe | ||
426 | local _u5143_u7d20b | ||
427 | do | ||
428 | local _obj_0, _obj_1, _obj_2, _obj_3, _obj_4 = _u51fd_u6570() | ||
429 | do | ||
430 | local _obj_5 = _u6570_u7ec4a | ||
431 | _obj_5[#_obj_5 + 1] = _obj_0 | ||
432 | end | ||
433 | setmetatable(_u5bf9_u8c61c, _obj_4) | ||
434 | _u53d8_u91cf1, _u53d8_u91cf2, _u53d8_u91cf3, _u53d8_u91cfd, _u53d8_u91cfe = 1, 2, 3, _obj_1, _obj_3 | ||
435 | _u5143_u7d20b = _obj_2[1] | ||
436 | end | ||
437 | local _u53d8_u91cfy1, _u53d8_u91cfy4 | ||
438 | local _u5b57_u6bb5y2, _u5b57_u6bb5y3 | ||
439 | do | ||
440 | local _obj_0, _obj_1 = _u51fd_u65702() | ||
441 | _u53d8_u91cfy1, _u53d8_u91cfy4 = _u51fd_u65701(), _obj_1 | ||
442 | _u5b57_u6bb5y2, _u5b57_u6bb5y3 = _obj_0["字段y2"], _obj_0["字段y3"] | ||
443 | end | ||
444 | end | ||
445 | do | ||
446 | local _u53d8_u91cfv1, _u53d8_u91cfv2, _u53d8_u91cfv3, _u53d8_u91cfv4 | ||
447 | do | ||
448 | local _obj_0 = _u5bf9_u8c61tb | ||
449 | local _tmp_0, _tmp_1 = 1 + 1, self.x | ||
450 | _u53d8_u91cfv1, _u53d8_u91cfv2, _u53d8_u91cfv3, _u53d8_u91cfv4 = _obj_0[ [["abc"]]], _obj_0[_tmp_0][1], _obj_0[_tmp_0][2], _obj_0[_tmp_1] | ||
451 | if _u53d8_u91cfv1 == nil then | ||
452 | _u53d8_u91cfv1 = 111 | ||
453 | end | ||
454 | if _u53d8_u91cfv2 == nil then | ||
455 | _u53d8_u91cfv2 = 222 | ||
456 | end | ||
457 | if _u53d8_u91cfv3 == nil then | ||
458 | _u53d8_u91cfv3 = 333 | ||
459 | end | ||
460 | if _u53d8_u91cfv4 == nil then | ||
461 | _u53d8_u91cfv4 = 444 | ||
462 | end | ||
463 | end | ||
464 | local _u53d8_u91cfv5, _u53d8_u91cfv6, _u53d8_u91cfv7 | ||
465 | do | ||
466 | local _obj_0 = _u5bf9_u8c61tb2 | ||
467 | local _tmp_2, _tmp_3 = _u51fd_u6570(), _u51fd_u65702() | ||
468 | _u53d8_u91cfv5, _u53d8_u91cfv6, _u53d8_u91cfv7 = _obj_0['x-y-z'], _obj_0[_tmp_2][_tmp_3], _obj_0[_tmp_2][1] | ||
469 | end | ||
470 | end | ||
471 | do | ||
472 | local _u503c, _u5143_u503c | ||
473 | do | ||
474 | local _obj_0 = _u5bf9_u8c61tb | ||
475 | _u503c = _obj_0[_u540d_u79f0] | ||
476 | _u5143_u503c = getmetatable(_obj_0)[_u540d_u79f0] | ||
477 | end | ||
478 | end | ||
479 | do | ||
480 | local tostring, add | ||
481 | do | ||
482 | local _obj_0 = getmetatable(_u5bf9_u8c61tb) | ||
483 | tostring, add = _obj_0.__tostring, _obj_0.__add | ||
484 | if tostring == nil then | ||
485 | tostring = (function() | ||
486 | return "名称" | ||
487 | end) | ||
488 | end | ||
489 | end | ||
490 | do | ||
491 | local _exp_0 = _u5bf9_u8c61tb | ||
492 | local _type_0 = type(_exp_0) | ||
493 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
494 | if _tab_0 then | ||
495 | local name, _u5143_u5b57_u6bb5 | ||
496 | do | ||
497 | local _obj_0 = getmetatable(_exp_0) | ||
498 | name = _obj_0.__name | ||
499 | _u5143_u5b57_u6bb5 = _obj_0["123"] | ||
500 | if name == nil then | ||
501 | name = "项目" | ||
502 | end | ||
503 | end | ||
504 | if _u5143_u5b57_u6bb5 ~= nil then | ||
505 | _u6253_u5370(name, _u5143_u5b57_u6bb5) | ||
506 | end | ||
507 | end | ||
508 | end | ||
509 | end | ||
510 | do | ||
511 | local _u5bf9_u8c61tb = { } | ||
512 | do | ||
513 | local _tmp_0 = _u51fd_u6570c() | ||
514 | local _u53d8_u91cfv2 = _u5bf9_u8c61tb[_tmp_0] | ||
515 | end | ||
516 | local _u53d8_u91cfv1 | ||
517 | do | ||
518 | local _obj_0 = getmetatable(_u5bf9_u8c61tb) | ||
519 | local _tmp_1 = _u53d8_u91cfa + _u53d8_u91cfb | ||
520 | _u53d8_u91cfv1 = _obj_0[_tmp_1] | ||
521 | end | ||
522 | end | ||
523 | do | ||
524 | local add, _u5b57_u6bb5 | ||
525 | do | ||
526 | local _obj_0 = _u5bf9_u8c61tb | ||
527 | add, _u5b57_u6bb5 = getmetatable(_obj_0.a).__add, getmetatable(_obj_0.b)[_u5b57_u6bb5_u540d] | ||
528 | if add == nil then | ||
529 | add = _u52a0_u51fd_u6570 | ||
530 | end | ||
531 | if _u5b57_u6bb5 == nil then | ||
532 | _u5b57_u6bb5 = 123 | ||
533 | end | ||
534 | end | ||
535 | local _u5143_u5b57_u6bb5, _u53d8_u91cfabc, _u6709_u9ed8_u8ba4_u503c | ||
536 | do | ||
537 | local _obj_0 = getmetatable(_u5bf9_u8c61tb) | ||
538 | _u5143_u5b57_u6bb5, _u53d8_u91cfabc, _u6709_u9ed8_u8ba4_u503c = _obj_0["字段abc"], _obj_0[ [[任意 字符串]]], _obj_0['字符串'] | ||
539 | if _u5143_u5b57_u6bb5 == nil then | ||
540 | _u5143_u5b57_u6bb5 = "默认值" | ||
541 | end | ||
542 | if _u53d8_u91cfabc == nil then | ||
543 | _u53d8_u91cfabc = 123 | ||
544 | end | ||
545 | if _u6709_u9ed8_u8ba4_u503c == nil then | ||
546 | _u6709_u9ed8_u8ba4_u503c = { } | ||
547 | end | ||
548 | end | ||
549 | do | ||
550 | local _exp_0 = _u5bf9_u8c61tb | ||
551 | local _type_0 = type(_exp_0) | ||
552 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
553 | if _tab_0 then | ||
554 | do | ||
555 | local _obj_0 = _exp_0["字段a"] | ||
556 | local _type_1 = type(_obj_0) | ||
557 | if "table" == _type_1 or "userdata" == _type_1 then | ||
558 | do | ||
559 | local _obj_1 = getmetatable(_obj_0) | ||
560 | local _type_2 = type(_obj_1) | ||
561 | if "table" == _type_2 or "userdata" == _type_2 then | ||
562 | add = _obj_1.__add | ||
563 | end | ||
564 | end | ||
565 | end | ||
566 | end | ||
567 | do | ||
568 | local _obj_0 = _exp_0.b | ||
569 | local _type_1 = type(_obj_0) | ||
570 | if "table" == _type_1 or "userdata" == _type_1 then | ||
571 | do | ||
572 | local _obj_1 = getmetatable(_obj_0) | ||
573 | local _type_2 = type(_obj_1) | ||
574 | if "table" == _type_2 or "userdata" == _type_2 then | ||
575 | _u5b57_u6bb5 = _obj_1[_u5b57_u6bb5_u540d] | ||
576 | end | ||
577 | end | ||
578 | end | ||
579 | end | ||
580 | if add == nil then | ||
581 | add = _u52a0_u51fd_u6570 | ||
582 | end | ||
583 | if _u5b57_u6bb5 == nil then | ||
584 | _u5b57_u6bb5 = 123 | ||
585 | end | ||
586 | _u6253_u5370(add, _u5b57_u6bb5) | ||
587 | end | ||
588 | end | ||
589 | do | ||
590 | local _exp_0 = tb | ||
591 | local _type_0 = type(_exp_0) | ||
592 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
593 | if _tab_0 then | ||
594 | do | ||
595 | local _obj_0 = _exp_0["字段c"] | ||
596 | local _type_1 = type(_obj_0) | ||
597 | if "table" == _type_1 or "userdata" == _type_1 then | ||
598 | do | ||
599 | local _obj_1 = getmetatable(_obj_0) | ||
600 | local _type_2 = type(_obj_1) | ||
601 | if "table" == _type_2 or "userdata" == _type_2 then | ||
602 | _u5143_u5b57_u6bb5 = _obj_1["字段abc"] | ||
603 | end | ||
604 | end | ||
605 | end | ||
606 | end | ||
607 | if _u5143_u5b57_u6bb5 == nil then | ||
608 | _u5143_u5b57_u6bb5 = "默认值" | ||
609 | end | ||
610 | do | ||
611 | local _obj_0 = getmetatable(_exp_0) | ||
612 | do | ||
613 | local _obj_1 = _obj_0[ [[any string]]] | ||
614 | local _type_1 = type(_obj_1) | ||
615 | if "table" == _type_1 or "userdata" == _type_1 then | ||
616 | _u53d8_u91cfabc = _obj_1["字段d"] | ||
617 | end | ||
618 | end | ||
619 | do | ||
620 | local _obj_1 = _obj_0['字符串'] | ||
621 | local _type_1 = type(_obj_1) | ||
622 | if "table" == _type_1 or "userdata" == _type_1 then | ||
623 | _u6709_u9ed8_u8ba4_u503c = _obj_1["字段e"] | ||
624 | end | ||
625 | end | ||
626 | if _u53d8_u91cfabc == nil then | ||
627 | _u53d8_u91cfabc = 123 | ||
628 | end | ||
629 | if _u6709_u9ed8_u8ba4_u503c == nil then | ||
630 | _u6709_u9ed8_u8ba4_u503c = { } | ||
631 | end | ||
632 | end | ||
633 | _u6253_u5370(_u5143_u5b57_u6bb5, _u53d8_u91cfabc, _u6709_u9ed8_u8ba4_u503c) | ||
634 | end | ||
635 | end | ||
636 | end | ||
637 | return nil | ||
diff --git a/spec/outputs/unicode/do.lua b/spec/outputs/unicode/do.lua new file mode 100644 index 0000000..f9c3079 --- /dev/null +++ b/spec/outputs/unicode/do.lua | |||
@@ -0,0 +1,48 @@ | |||
1 | do | ||
2 | _u6253_u5370("你好") | ||
3 | _u6253_u5370("世界") | ||
4 | end | ||
5 | local _u53d8_u91cfx | ||
6 | do | ||
7 | _u6253_u5370("你好") | ||
8 | _u53d8_u91cfx = _u6253_u5370("世界") | ||
9 | end | ||
10 | local _u53d8_u91cfy | ||
11 | do | ||
12 | local _u4e1c_u897f = "shhh" | ||
13 | _u53d8_u91cfy = function() | ||
14 | return "你好: " .. _u4e1c_u897f | ||
15 | end | ||
16 | end | ||
17 | local _ | ||
18 | _ = function() | ||
19 | if _u67d0_u6761_u4ef6 then | ||
20 | do | ||
21 | return "好的" | ||
22 | end | ||
23 | end | ||
24 | end | ||
25 | local _u53d8_u91cft = { | ||
26 | ["y字段"] = (function() | ||
27 | local _u6570_u5b57 = 100 | ||
28 | return function(_u53c2_u6570x) | ||
29 | return _u53c2_u6570x + _u6570_u5b57 | ||
30 | end | ||
31 | end)() | ||
32 | } | ||
33 | return function(_u53c2_u6570y, _u53c2_u6570k) | ||
34 | if _u53c2_u6570y == nil then | ||
35 | do | ||
36 | _u53d8_u91cfx = 10 + 2 | ||
37 | _u53c2_u6570y = _u53d8_u91cfx | ||
38 | end | ||
39 | end | ||
40 | if _u53c2_u6570k == nil then | ||
41 | do | ||
42 | _u53c2_u6570k = "没啥" | ||
43 | end | ||
44 | end | ||
45 | do | ||
46 | return "啊" | ||
47 | end | ||
48 | end | ||
diff --git a/spec/outputs/unicode/existential.lua b/spec/outputs/unicode/existential.lua new file mode 100644 index 0000000..7cc6089 --- /dev/null +++ b/spec/outputs/unicode/existential.lua | |||
@@ -0,0 +1,223 @@ | |||
1 | do | ||
2 | local _obj_0 = _u51fd_u65701 | ||
3 | if _obj_0 ~= nil then | ||
4 | _obj_0() | ||
5 | end | ||
6 | end | ||
7 | do | ||
8 | local _obj_0 = _u51fd_u65702 | ||
9 | if _obj_0 ~= nil then | ||
10 | _obj_0("参数0", 123) | ||
11 | end | ||
12 | end | ||
13 | local _u53d8_u91cfx | ||
14 | do | ||
15 | local _obj_0 = _u8868 | ||
16 | if _obj_0 ~= nil then | ||
17 | _u53d8_u91cfx = _obj_0["值"] | ||
18 | end | ||
19 | end | ||
20 | _u6253_u5370((function() | ||
21 | local _obj_0 = _u5bf9_u8c61abc | ||
22 | if _obj_0 ~= nil then | ||
23 | local _obj_1 = _obj_0["你好 世界"] | ||
24 | if _obj_1 ~= nil then | ||
25 | return _obj_1["字段xyz"] | ||
26 | end | ||
27 | return nil | ||
28 | end | ||
29 | return nil | ||
30 | end)()) | ||
31 | if _u6253_u5370 and (_u53d8_u91cfx ~= nil) then | ||
32 | _u6253_u5370(_u53d8_u91cfx) | ||
33 | end | ||
34 | do | ||
35 | local _obj_0 = self | ||
36 | if _obj_0 ~= nil then | ||
37 | _obj_0["函数"](_obj_0, 998) | ||
38 | end | ||
39 | end | ||
40 | do | ||
41 | local _with_0 | ||
42 | do | ||
43 | local _obj_0 = _u5bf9_u8c61abc | ||
44 | if _obj_0 ~= nil then | ||
45 | do | ||
46 | local _obj_1 = _obj_0() | ||
47 | local _obj_2 = _obj_1["函数"] | ||
48 | if _obj_2 ~= nil then | ||
49 | _with_0 = _obj_2(_obj_1) | ||
50 | end | ||
51 | end | ||
52 | end | ||
53 | end | ||
54 | if (function() | ||
55 | local _obj_0 = _with_0["函数p"] | ||
56 | if _obj_0 ~= nil then | ||
57 | return _obj_0(_with_0, "abc") | ||
58 | end | ||
59 | return nil | ||
60 | end)() then | ||
61 | return 123 | ||
62 | end | ||
63 | end | ||
64 | do | ||
65 | local _des_0 | ||
66 | do | ||
67 | local _obj_0 = _u5bf9_u8c61a | ||
68 | if _obj_0 ~= nil then | ||
69 | do | ||
70 | local _obj_1 = _obj_0["如果"] | ||
71 | if _obj_1 ~= nil then | ||
72 | do | ||
73 | local _obj_2 = _obj_1["然后"] | ||
74 | if _obj_2 ~= nil then | ||
75 | do | ||
76 | local _obj_3 = _obj_2(_obj_1, 123) | ||
77 | if _obj_3 ~= nil then | ||
78 | _des_0 = _obj_3((function() | ||
79 | local _obj_4 = self | ||
80 | if _obj_4 ~= nil then | ||
81 | return _obj_4["方法"](_obj_4, 998) | ||
82 | end | ||
83 | return nil | ||
84 | end)()) | ||
85 | end | ||
86 | end | ||
87 | end | ||
88 | end | ||
89 | end | ||
90 | end | ||
91 | end | ||
92 | end | ||
93 | if _des_0 then | ||
94 | local x_u5b57_u6bb5 = _des_0["x字段"] | ||
95 | _u6253_u5370(x_u5b57_u6bb5) | ||
96 | end | ||
97 | end | ||
98 | local _u7ed3_u679c = ((function() | ||
99 | local _call_0 = _u5bf9_u8c61b["方法"] | ||
100 | local _obj_0 = _call_0["执行"](_call_0) | ||
101 | local _obj_1 = _obj_0["当"] | ||
102 | if _obj_1 ~= nil then | ||
103 | local _call_1 = _obj_1(_obj_0, "没问题") | ||
104 | local _base_0 = _call_1["如果"](_call_1, "默认", 998) | ||
105 | local _fn_0 = _base_0["函数"] | ||
106 | return _fn_0 and function(...) | ||
107 | return _fn_0(_base_0, ...) | ||
108 | end | ||
109 | end | ||
110 | return nil | ||
111 | end)() ~= nil) | ||
112 | _u6253_u5370(_u7ed3_u679c) | ||
113 | local _u81ea_u6211_u4e3a_u4e2d_u5fc3 | ||
114 | if (_u601d_u60f3 ~= nil) and not (_u4e16_u754c ~= nil) then | ||
115 | _u81ea_u6211_u4e3a_u4e2d_u5fc3 = true | ||
116 | end | ||
117 | local _u901f_u5ea6 = 0 | ||
118 | _u901f_u5ea6 = _u901f_u5ea6 or 15 | ||
119 | local _u811a_u5370 = _u91ce_u4eba or "熊" | ||
120 | local _u4e13_u4e1a = '计算机科学' | ||
121 | if not (_u4e13_u4e1a ~= nil) then | ||
122 | _u9009_u4fee_u8bfe_u7a0b('葡萄酒入门') | ||
123 | end | ||
124 | if (_u7a97_u4f53 ~= nil) then | ||
125 | local _u73af_u5883 = '浏览器(有可能)' | ||
126 | end | ||
127 | local _u90ae_u7f16 | ||
128 | do | ||
129 | local _obj_0 = _u62bd_u5956["中奖者"] | ||
130 | if _obj_0 ~= nil then | ||
131 | do | ||
132 | local _obj_1 = _obj_0()["地址"] | ||
133 | if _obj_1 ~= nil then | ||
134 | _u90ae_u7f16 = _obj_1["邮政编码"] | ||
135 | end | ||
136 | end | ||
137 | end | ||
138 | end | ||
139 | local _u957f_u5ea6 = (function() | ||
140 | local _obj_0 = utf8 | ||
141 | if _obj_0 ~= nil then | ||
142 | return _obj_0["长度"] | ||
143 | end | ||
144 | return nil | ||
145 | end)() or (function() | ||
146 | local _obj_0 = _u5b57_u7b26_u4e32 | ||
147 | if _obj_0 ~= nil then | ||
148 | return _obj_0["长度"] | ||
149 | end | ||
150 | return nil | ||
151 | end)() or function(_u5bf9_u8c61) | ||
152 | return #_u5bf9_u8c61 | ||
153 | end | ||
154 | local _u53d8_u91cfa | ||
155 | do | ||
156 | local _obj_0 = _u88681 | ||
157 | if _obj_0 ~= nil then | ||
158 | do | ||
159 | local _obj_1 = _obj_0["结束"] | ||
160 | if _obj_1 ~= nil then | ||
161 | _u53d8_u91cfa = _obj_1(_obj_0, 123 + (function() | ||
162 | local _obj_2 = _u88682 | ||
163 | if _obj_2 ~= nil then | ||
164 | return _obj_2["然后"](_obj_2, 456) | ||
165 | end | ||
166 | return nil | ||
167 | end)()) | ||
168 | end | ||
169 | end | ||
170 | end | ||
171 | end | ||
172 | local _u53d8_u91cfb = ((function() | ||
173 | local _obj_0 = _u88681 | ||
174 | if _obj_0 ~= nil then | ||
175 | local _base_0 = _obj_0 | ||
176 | local _fn_0 = _base_0["结束"] | ||
177 | return _fn_0 and function(...) | ||
178 | return _fn_0(_base_0, ...) | ||
179 | end | ||
180 | end | ||
181 | return nil | ||
182 | end)() ~= nil) or (function() | ||
183 | local _obj_0 = _u88682 | ||
184 | if _obj_0 ~= nil then | ||
185 | local _base_0 = _obj_0 | ||
186 | local _fn_0 = _base_0["然后"] | ||
187 | return _fn_0 and function(...) | ||
188 | return _fn_0(_base_0, ...) | ||
189 | end | ||
190 | end | ||
191 | return nil | ||
192 | end)() | ||
193 | do | ||
194 | local _with_0 = io.open("测试.txt", "w") | ||
195 | if _with_0 ~= nil then | ||
196 | _with_0:write("你好") | ||
197 | _with_0:close() | ||
198 | end | ||
199 | end | ||
200 | do | ||
201 | local _obj_0 = _u8868 | ||
202 | if _obj_0 ~= nil then | ||
203 | do | ||
204 | local _obj_1 = getmetatable(_obj_0).__call | ||
205 | if _obj_1 ~= nil then | ||
206 | _obj_1(123) | ||
207 | end | ||
208 | end | ||
209 | end | ||
210 | end | ||
211 | do | ||
212 | local _with_0 | ||
213 | do | ||
214 | local _obj_0 = getmetatable(_u8868) | ||
215 | if _obj_0 ~= nil then | ||
216 | _with_0 = getmetatable(_obj_0).__index | ||
217 | end | ||
218 | end | ||
219 | if _with_0 ~= nil then | ||
220 | _with_0["字段a"] = 1 | ||
221 | end | ||
222 | end | ||
223 | return nil | ||
diff --git a/spec/outputs/unicode/export.lua b/spec/outputs/unicode/export.lua new file mode 100644 index 0000000..ef35fe5 --- /dev/null +++ b/spec/outputs/unicode/export.lua | |||
@@ -0,0 +1,338 @@ | |||
1 | local _module_0 = setmetatable({ }, { }) | ||
2 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = 223, 343, 123 | ||
3 | _module_0["变量a"], _module_0["变量b"], _module_0["变量c"] = _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc | ||
4 | local _u9177 = "🧧" | ||
5 | _module_0["酷"] = _u9177 | ||
6 | local _u53d8_u91cfd, _u53d8_u91cfe, _u53d8_u91cff = 3, 2, 1 | ||
7 | _module_0[#_module_0 + 1] = _u53d8_u91cfd | ||
8 | _module_0[#_module_0 + 1] = _u53d8_u91cfe | ||
9 | _module_0[#_module_0 + 1] = _u53d8_u91cff | ||
10 | local _u67d0_u7c7b | ||
11 | do | ||
12 | local _class_0 | ||
13 | local _base_0 = { | ||
14 | ["嗯"] = "酷" | ||
15 | } | ||
16 | if _base_0.__index == nil then | ||
17 | _base_0.__index = _base_0 | ||
18 | end | ||
19 | _class_0 = setmetatable({ | ||
20 | __init = function() end, | ||
21 | __base = _base_0, | ||
22 | __name = "某类" | ||
23 | }, { | ||
24 | __index = _base_0, | ||
25 | __call = function(cls, ...) | ||
26 | local _self_0 = setmetatable({ }, _base_0) | ||
27 | cls.__init(_self_0, ...) | ||
28 | return _self_0 | ||
29 | end | ||
30 | }) | ||
31 | _base_0.__class = _class_0 | ||
32 | _u67d0_u7c7b = _class_0 | ||
33 | end | ||
34 | _module_0["_u67d0_u7c7b"] = _u67d0_u7c7b | ||
35 | if _u8fd9_u4e2a then | ||
36 | _module_0[#_module_0 + 1] = 232 | ||
37 | else | ||
38 | _module_0[#_module_0 + 1] = 4343 | ||
39 | end | ||
40 | local _u4ec0_u4e48 | ||
41 | if _u8fd9_u4e2a then | ||
42 | _u4ec0_u4e48 = 232 | ||
43 | else | ||
44 | _u4ec0_u4e48 = 4343 | ||
45 | end | ||
46 | _module_0["什么"] = _u4ec0_u4e48 | ||
47 | local _u53d8_u91cfy | ||
48 | _u53d8_u91cfy = function() | ||
49 | local _u4f60_u597d = 3434 | ||
50 | end | ||
51 | _module_0["变量y"] = _u53d8_u91cfy | ||
52 | do | ||
53 | local _with_0 = _u4e34_u65f6 | ||
54 | local _u53d8_u91cfj = 2000 | ||
55 | _module_0[#_module_0 + 1] = _with_0 | ||
56 | end | ||
57 | local cb_u7684_u503c | ||
58 | do | ||
59 | local _u53d8_u91cfh = 100 | ||
60 | cb_u7684_u503c = _u51fd_u6570(function(_u53c2_u6570) | ||
61 | return _u53c2_u6570(h_u53d8_u91cf) | ||
62 | end) | ||
63 | end | ||
64 | _module_0["cb的值"] = cb_u7684_u503c | ||
65 | local _u4e2b_u4e2b | ||
66 | _u4e2b_u4e2b = function() | ||
67 | local _u53d8_u91cfh = 100 | ||
68 | local _u53d8_u91cfk = 100 | ||
69 | end | ||
70 | _module_0["丫丫"] = _u4e2b_u4e2b | ||
71 | do | ||
72 | local _exp_0 = _u53d8_u91cfh | ||
73 | if 100 == _exp_0 or 150 == _exp_0 then | ||
74 | _module_0[#_module_0 + 1] = 200 | ||
75 | elseif 200 == _exp_0 then | ||
76 | _module_0[#_module_0 + 1] = 300 | ||
77 | else | ||
78 | _module_0[#_module_0 + 1] = 0 | ||
79 | end | ||
80 | end | ||
81 | local _u5e38_u91cf | ||
82 | do | ||
83 | local _exp_0 = _u503c | ||
84 | if "好" == _exp_0 then | ||
85 | _u5e38_u91cf = 1 | ||
86 | elseif "更好" == _exp_0 then | ||
87 | _u5e38_u91cf = 2 | ||
88 | elseif "最好" == _exp_0 then | ||
89 | _u5e38_u91cf = 3 | ||
90 | end | ||
91 | end | ||
92 | _module_0["常量"] = _u5e38_u91cf | ||
93 | local _u9879_u76ee = _u51fd_u6570(123) | ||
94 | _module_0["项目"] = _u9879_u76ee | ||
95 | _module_0[#_module_0 + 1] = _u53d8_u91cfx | ||
96 | _u51fd_u6570((function() | ||
97 | if _u6761_u4ef6a then | ||
98 | return _u503cb | ||
99 | end | ||
100 | end)()) | ||
101 | _u51fd_u6570((function() | ||
102 | return 123 | ||
103 | end)()) | ||
104 | _u51fd_u6570((function() | ||
105 | local _exp_0 = _u5bf9_u8c61a | ||
106 | if _u53d8_u91cfb == _exp_0 then | ||
107 | return _u503cc | ||
108 | end | ||
109 | end)()) | ||
110 | _u51fd_u6570((function() | ||
111 | local _accum_0 = { } | ||
112 | local _len_0 = 1 | ||
113 | for _u8ba1_u6570 = 1, 10 do | ||
114 | _accum_0[_len_0] = _u8ba1_u6570 | ||
115 | _len_0 = _len_0 + 1 | ||
116 | end | ||
117 | return _accum_0 | ||
118 | end)()) | ||
119 | _u51fd_u6570((function() | ||
120 | local _accum_0 = { } | ||
121 | local _len_0 = 1 | ||
122 | for _u8ba1_u6570 = 1, 10 do | ||
123 | _accum_0[_len_0] = _u8ba1_u6570 | ||
124 | _len_0 = _len_0 + 1 | ||
125 | end | ||
126 | return _accum_0 | ||
127 | end)()) | ||
128 | _u51fd_u6570((function() | ||
129 | local _tbl_0 = { } | ||
130 | for _u952e, _u503c in pairs(_u8868) do | ||
131 | _tbl_0[_u952e] = _u503c | ||
132 | end | ||
133 | return _tbl_0 | ||
134 | end)()) | ||
135 | _u51fd_u6570((function() | ||
136 | local _accum_0 = { } | ||
137 | local _len_0 = 1 | ||
138 | for _u952e, _u503c in pairs(_u8868) do | ||
139 | _accum_0[_len_0] = { | ||
140 | _u952e, | ||
141 | _u503c | ||
142 | } | ||
143 | _len_0 = _len_0 + 1 | ||
144 | end | ||
145 | return _accum_0 | ||
146 | end)()) | ||
147 | _u51fd_u6570((function() | ||
148 | local _accum_0 = { } | ||
149 | local _len_0 = 1 | ||
150 | while _u6761_u4ef6a do | ||
151 | _accum_0[_len_0] = true | ||
152 | _len_0 = _len_0 + 1 | ||
153 | end | ||
154 | return _accum_0 | ||
155 | end)()) | ||
156 | _u51fd_u6570((function() | ||
157 | local _with_0 = _u6761_u4ef6a | ||
158 | _with_0["字段b"] = 123 | ||
159 | return _with_0 | ||
160 | end)()) | ||
161 | _u51fd_u6570((function() | ||
162 | local _obj_0 = _u5bf9_u8c61a | ||
163 | if _obj_0 ~= nil then | ||
164 | return _obj_0["字段b"] | ||
165 | end | ||
166 | return nil | ||
167 | end)()) | ||
168 | _u51fd_u6570((function() | ||
169 | local _base_0 = _u5bf9_u8c61a | ||
170 | local _fn_0 = _base_0["字段b"] | ||
171 | return _fn_0 and function(...) | ||
172 | return _fn_0(_base_0, ...) | ||
173 | end | ||
174 | end)()) | ||
175 | _u51fd_u6570((function() | ||
176 | local A_u7c7b | ||
177 | do | ||
178 | local _class_0 | ||
179 | local _base_0 = { } | ||
180 | if _base_0.__index == nil then | ||
181 | _base_0.__index = _base_0 | ||
182 | end | ||
183 | _class_0 = setmetatable({ | ||
184 | __init = function() end, | ||
185 | __base = _base_0, | ||
186 | __name = "A类" | ||
187 | }, { | ||
188 | __index = _base_0, | ||
189 | __call = function(cls, ...) | ||
190 | local _self_0 = setmetatable({ }, _base_0) | ||
191 | cls.__init(_self_0, ...) | ||
192 | return _self_0 | ||
193 | end | ||
194 | }) | ||
195 | _base_0.__class = _class_0 | ||
196 | A_u7c7b = _class_0 | ||
197 | return _class_0 | ||
198 | end | ||
199 | end)()) | ||
200 | local _ = tostring((function() | ||
201 | if _u6761_u4ef6a then | ||
202 | return _u503cb | ||
203 | end | ||
204 | end)()) | ||
205 | _ = tostring((function() | ||
206 | return 123 | ||
207 | end)()) | ||
208 | _ = tostring((function() | ||
209 | local _exp_0 = _u5bf9_u8c61a | ||
210 | if _u53d8_u91cfb == _exp_0 then | ||
211 | return _u503cc | ||
212 | end | ||
213 | end)()) | ||
214 | _ = tostring((function() | ||
215 | local _accum_0 = { } | ||
216 | local _len_0 = 1 | ||
217 | for _u8ba1_u6570 = 1, 10 do | ||
218 | _accum_0[_len_0] = _u8ba1_u6570 | ||
219 | _len_0 = _len_0 + 1 | ||
220 | end | ||
221 | return _accum_0 | ||
222 | end)()) | ||
223 | _ = tostring((function() | ||
224 | local _accum_0 = { } | ||
225 | local _len_0 = 1 | ||
226 | for _u8ba1_u6570 = 1, 10 do | ||
227 | _accum_0[_len_0] = _u8ba1_u6570 | ||
228 | _len_0 = _len_0 + 1 | ||
229 | end | ||
230 | return _accum_0 | ||
231 | end)()) | ||
232 | _ = tostring((function() | ||
233 | local _tbl_0 = { } | ||
234 | for _u952e, _u503c in pairs(_u8868) do | ||
235 | _tbl_0[_u952e] = _u503c | ||
236 | end | ||
237 | return _tbl_0 | ||
238 | end)()) | ||
239 | _ = tostring((function() | ||
240 | local _accum_0 = { } | ||
241 | local _len_0 = 1 | ||
242 | for _u952e, _u503c in pairs(_u8868) do | ||
243 | _accum_0[_len_0] = { | ||
244 | _u952e, | ||
245 | _u503c | ||
246 | } | ||
247 | _len_0 = _len_0 + 1 | ||
248 | end | ||
249 | return _accum_0 | ||
250 | end)()) | ||
251 | _ = tostring((function() | ||
252 | local _accum_0 = { } | ||
253 | local _len_0 = 1 | ||
254 | while _u6761_u4ef6a do | ||
255 | _accum_0[_len_0] = true | ||
256 | _len_0 = _len_0 + 1 | ||
257 | end | ||
258 | return _accum_0 | ||
259 | end)()) | ||
260 | _ = tostring((function() | ||
261 | local _with_0 = _u5bf9_u8c61a | ||
262 | _with_0["字段b"] = 123 | ||
263 | return _with_0 | ||
264 | end)()) | ||
265 | _ = tostring((function() | ||
266 | local _obj_0 = _u5bf9_u8c61a | ||
267 | if _obj_0 ~= nil then | ||
268 | return _obj_0["字段b"] | ||
269 | end | ||
270 | return nil | ||
271 | end)()) | ||
272 | _ = tostring((function() | ||
273 | local _base_0 = _u5bf9_u8c61a | ||
274 | local _fn_0 = _base_0["字段b"] | ||
275 | return _fn_0 and function(...) | ||
276 | return _fn_0(_base_0, ...) | ||
277 | end | ||
278 | end)()) | ||
279 | _ = tostring((function() | ||
280 | local A_u7c7b | ||
281 | do | ||
282 | local _class_0 | ||
283 | local _base_0 = { } | ||
284 | if _base_0.__index == nil then | ||
285 | _base_0.__index = _base_0 | ||
286 | end | ||
287 | _class_0 = setmetatable({ | ||
288 | __init = function() end, | ||
289 | __base = _base_0, | ||
290 | __name = "A类" | ||
291 | }, { | ||
292 | __index = _base_0, | ||
293 | __call = function(cls, ...) | ||
294 | local _self_0 = setmetatable({ }, _base_0) | ||
295 | cls.__init(_self_0, ...) | ||
296 | return _self_0 | ||
297 | end | ||
298 | }) | ||
299 | _base_0.__class = _class_0 | ||
300 | A_u7c7b = _class_0 | ||
301 | return _class_0 | ||
302 | end | ||
303 | end)()) | ||
304 | local _u53d8_u91cf1, _u53d8_u91cf2, _u53d8_u91cf3, _u7c7b4, _u53d8_u91cf5 | ||
305 | _u53d8_u91cf1 = 1 | ||
306 | _u53d8_u91cf2 = 2 | ||
307 | _module_0["变量2"] = _u53d8_u91cf2 | ||
308 | do | ||
309 | local _class_0 | ||
310 | local _base_0 = { } | ||
311 | if _base_0.__index == nil then | ||
312 | _base_0.__index = _base_0 | ||
313 | end | ||
314 | _class_0 = setmetatable({ | ||
315 | __init = function() end, | ||
316 | __base = _base_0, | ||
317 | __name = "类4" | ||
318 | }, { | ||
319 | __index = _base_0, | ||
320 | __call = function(cls, ...) | ||
321 | local _self_0 = setmetatable({ }, _base_0) | ||
322 | cls.__init(_self_0, ...) | ||
323 | return _self_0 | ||
324 | end | ||
325 | }) | ||
326 | _base_0.__class = _class_0 | ||
327 | _u7c7b4 = _class_0 | ||
328 | _u53d8_u91cf3 = _class_0 | ||
329 | end | ||
330 | _module_0["变量3"] = _u53d8_u91cf3 | ||
331 | _u53d8_u91cf5 = 5 | ||
332 | getmetatable(_module_0)["🀄️"] = 1 | ||
333 | getmetatable(_module_0).__name = "导出" | ||
334 | getmetatable(_module_0).__call = function(self) | ||
335 | return { } | ||
336 | end | ||
337 | _module_0["导出-任意-名称"] = 123 | ||
338 | return _module_0 | ||
diff --git a/spec/outputs/unicode/export_default.lua b/spec/outputs/unicode/export_default.lua new file mode 100644 index 0000000..6d48af2 --- /dev/null +++ b/spec/outputs/unicode/export_default.lua | |||
@@ -0,0 +1,19 @@ | |||
1 | local _module_0 = nil | ||
2 | _u6253_u5370("没问题") | ||
3 | _module_0 = function() | ||
4 | _u6253_u5370("你好") | ||
5 | return 123 | ||
6 | end | ||
7 | if not _u662f_u5426_u7ed3_u675f then | ||
8 | _u51fd_u6570(123, "abc", function(_u53c2_u6570x, _u56de_u8c03y) | ||
9 | _u6253_u5370(_u53c2_u6570x) | ||
10 | return _u56de_u8c03y(function(_u53c2_u6570y, _u7ed3_u679c) | ||
11 | if _u7ed3_u679c then | ||
12 | return _u53d8_u91cfabc + _u53c2_u6570y | ||
13 | else | ||
14 | return _u53d8_u91cfabc | ||
15 | end | ||
16 | end) | ||
17 | end) | ||
18 | end | ||
19 | return _module_0 | ||
diff --git a/spec/outputs/unicode/funcs.lua b/spec/outputs/unicode/funcs.lua new file mode 100644 index 0000000..6e94587 --- /dev/null +++ b/spec/outputs/unicode/funcs.lua | |||
@@ -0,0 +1,222 @@ | |||
1 | local _u53d8_u91cfx | ||
2 | _u53d8_u91cfx = function() | ||
3 | return _u6253_u5370(_u4ec0_u4e48) | ||
4 | end | ||
5 | local __u65e0_u6548_u53d8_u91cf | ||
6 | __u65e0_u6548_u53d8_u91cf = function() end | ||
7 | __u65e0_u6548_u53d8_u91cf = function() | ||
8 | return function() | ||
9 | return function() end | ||
10 | end | ||
11 | end | ||
12 | _u5230(_u8c37(_u4ed3(_u53bb))) | ||
13 | _u5f00(function() | ||
14 | return _u8fd9_u6247(function() | ||
15 | return _u95e8 | ||
16 | end) | ||
17 | end) | ||
18 | _u5f00(function() | ||
19 | _u8fd9_u6247(_u95e8) | ||
20 | local _u4f60_u597d | ||
21 | _u4f60_u597d = function() | ||
22 | return _u6211_u7684(_u51fd_u6570) | ||
23 | end | ||
24 | end) | ||
25 | local _u53d8_u91cfh | ||
26 | _u53d8_u91cfh = function() | ||
27 | return _ud83d_udc4b | ||
28 | end | ||
29 | _u5403(function() end, _u4e16_u754c); | ||
30 | (function() end)() | ||
31 | _u53d8_u91cfx = function(...) end | ||
32 | _u4f60_u597d() | ||
33 | _u4f60_u597d["世界"]() | ||
34 | __u65e0_u6548_u53d8_u91cf = _u4f60_u597d()["某物"] | ||
35 | __u65e0_u6548_u53d8_u91cf = _u4ec0_u4e48()["🥵🥵🥵"] | ||
36 | _u4ec0()(_u4e48()(_u60c5_u51b5())) | ||
37 | __u65e0_u6548_u53d8_u91cf = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c, _u53c2_u6570d, _u53c2_u6570e) end | ||
38 | __u65e0_u6548_u53d8_u91cf = function(_u53c2_u6570, _u53c2_u6570, _u53c2_u6570, _u53c2_u6570, _u53c2_u6570) | ||
39 | return _u6253_u5370(_u53c2_u6570) | ||
40 | end | ||
41 | __u65e0_u6548_u53d8_u91cf = function(_u53c2_u6570x) | ||
42 | if _u53c2_u6570x == nil then | ||
43 | _u53c2_u6570x = 23023 | ||
44 | end | ||
45 | end | ||
46 | __u65e0_u6548_u53d8_u91cf = function(_u53c2_u6570x) | ||
47 | if _u53c2_u6570x == nil then | ||
48 | _u53c2_u6570x = function(_u53c2_u6570y) | ||
49 | if _u53c2_u6570y == nil then | ||
50 | _u53c2_u6570y = function() end | ||
51 | end | ||
52 | end | ||
53 | end | ||
54 | end | ||
55 | __u65e0_u6548_u53d8_u91cf = function(_u53d8_u91cfx) | ||
56 | if _u53d8_u91cfx == nil then | ||
57 | if _u67d0_u7269 then | ||
58 | _u53d8_u91cfx = _u597d | ||
59 | else | ||
60 | _u53d8_u91cfx = _u574f | ||
61 | end | ||
62 | end | ||
63 | end | ||
64 | local _u67d0_u7269 | ||
65 | _u67d0_u7269 = function(_u4f60_u597d, _u4e16_u754c) | ||
66 | if _u4f60_u597d == nil then | ||
67 | _u4f60_u597d = 100 | ||
68 | end | ||
69 | if _u4e16_u754c == nil then | ||
70 | _u4e16_u754c = function(_u53c2_u6570x) | ||
71 | if _u53c2_u6570x == nil then | ||
72 | _u53c2_u6570x = [[好 酷]] | ||
73 | end | ||
74 | return _u6253_u5370("吃米饭") | ||
75 | end | ||
76 | end | ||
77 | return _u6253_u5370(_u4f60_u597d) | ||
78 | end | ||
79 | __u65e0_u6548_u53d8_u91cf = function(self) end | ||
80 | __u65e0_u6548_u53d8_u91cf = function(self, _u53c2_u6570x, _u53c2_u6570y) end | ||
81 | __u65e0_u6548_u53d8_u91cf = function(self, _u53c2_u6570x, _u53c2_u6570y) | ||
82 | self["参数x"] = _u53c2_u6570x | ||
83 | self["参数y"] = _u53c2_u6570y | ||
84 | end | ||
85 | __u65e0_u6548_u53d8_u91cf = function(self, _u53c2_u6570x) | ||
86 | if _u53c2_u6570x == nil then | ||
87 | _u53c2_u6570x = 1 | ||
88 | end | ||
89 | end | ||
90 | __u65e0_u6548_u53d8_u91cf = function(self, _u53c2_u6570x, _u53c2_u6570y, _u53c2_u6570z) | ||
91 | if _u53c2_u6570x == nil then | ||
92 | _u53c2_u6570x = 1 | ||
93 | end | ||
94 | if _u53c2_u6570z == nil then | ||
95 | _u53c2_u6570z = "你好 世界" | ||
96 | end | ||
97 | self["参数x"] = _u53c2_u6570x | ||
98 | self["参数z"] = _u53c2_u6570z | ||
99 | end | ||
100 | _u53d8_u91cfx(function() | ||
101 | return | ||
102 | end) | ||
103 | _u53d8_u91cfy(function() | ||
104 | return 1 | ||
105 | end) | ||
106 | _u53d8_u91cfz(function() | ||
107 | return 1, "你好", "世界" | ||
108 | end) | ||
109 | _u53d8_u91cfk(function() | ||
110 | if _u662f then | ||
111 | return | ||
112 | else | ||
113 | return | ||
114 | end | ||
115 | end) | ||
116 | __u65e0_u6548_u53d8_u91cf = function() | ||
117 | if _u67d0_u7269 then | ||
118 | return _u771f_u540d | ||
119 | end | ||
120 | end | ||
121 | _u51fd_u6570d(function() | ||
122 | return _u6253_u5370("你好 世界") | ||
123 | end, 10) | ||
124 | _u51fd_u6570d(1, 2, 3, 4, 5, 6, (function() | ||
125 | if _u67d0_u7269 then | ||
126 | _u6253_u5370("okay") | ||
127 | return 10 | ||
128 | end | ||
129 | end)(), 10, 20) | ||
130 | _u51fd_u6570f()()(_u4ec0_u4e48)(function() | ||
131 | return _u6253_u5370("srue") | ||
132 | end, 123) | ||
133 | _u53d8_u91cfx = function(_u53c2_u6570a, _u53c2_u6570b) | ||
134 | return _u6253_u5370("什么") | ||
135 | end | ||
136 | local _u53d8_u91cfy | ||
137 | _u53d8_u91cfy = function(_u53c2_u6570a, _u53c2_u6570b) | ||
138 | if _u53c2_u6570a == nil then | ||
139 | _u53c2_u6570a = "hi" | ||
140 | end | ||
141 | if _u53c2_u6570b == nil then | ||
142 | _u53c2_u6570b = 23 | ||
143 | end | ||
144 | return _u6253_u5370("什么") | ||
145 | end | ||
146 | local _u53d8_u91cfz | ||
147 | _u53d8_u91cfz = function(_u53c2_u6570a, _u53c2_u6570b) | ||
148 | if _u53c2_u6570a == nil then | ||
149 | _u53c2_u6570a = "hi" | ||
150 | end | ||
151 | if _u53c2_u6570b == nil then | ||
152 | _u53c2_u6570b = 23 | ||
153 | end | ||
154 | return _u6253_u5370("什么") | ||
155 | end | ||
156 | local _u53d8_u91cfj | ||
157 | _u53d8_u91cfj = function(_u53c2_u6570f, _u53c2_u6570g, _u53c2_u6570m, _u53c2_u6570a, _u53c2_u6570b) | ||
158 | if _u53c2_u6570a == nil then | ||
159 | _u53c2_u6570a = "hi" | ||
160 | end | ||
161 | if _u53c2_u6570b == nil then | ||
162 | _u53c2_u6570b = 23 | ||
163 | end | ||
164 | return _u6253_u5370("什么") | ||
165 | end | ||
166 | _u53d8_u91cfy = function(_u53c2_u6570a, _u53c2_u6570b, ...) | ||
167 | if _u53c2_u6570a == nil then | ||
168 | _u53c2_u6570a = "hi" | ||
169 | end | ||
170 | if _u53c2_u6570b == nil then | ||
171 | _u53c2_u6570b = 23 | ||
172 | end | ||
173 | return _u6253_u5370("什么") | ||
174 | end | ||
175 | _u53d8_u91cfy = function(_u53c2_u6570a, _u53c2_u6570b, ...) | ||
176 | if _u53c2_u6570a == nil then | ||
177 | _u53c2_u6570a = "hi" | ||
178 | end | ||
179 | if _u53c2_u6570b == nil then | ||
180 | _u53c2_u6570b = 23 | ||
181 | end | ||
182 | return _u6253_u5370("什么") | ||
183 | end | ||
184 | local _u591a_u53c2_u6570 | ||
185 | _u591a_u53c2_u6570 = function(_u53c2_u6570a, _u53c2_u6570b) | ||
186 | return _u6253_u5370("什么") | ||
187 | end | ||
188 | _u591a_u53c2_u6570 = function(_u53c2_u6570a, _u53c2_u6570b) | ||
189 | if _u53c2_u6570a == nil then | ||
190 | _u53c2_u6570a = "hi" | ||
191 | end | ||
192 | if _u53c2_u6570b == nil then | ||
193 | _u53c2_u6570b = 23 | ||
194 | end | ||
195 | return _u6253_u5370("什么") | ||
196 | end | ||
197 | _u591a_u53c2_u6570 = function(_u53c2_u6570a, _u53c2_u6570b) | ||
198 | if _u53c2_u6570a == nil then | ||
199 | _u53c2_u6570a = "hi" | ||
200 | end | ||
201 | if _u53c2_u6570b == nil then | ||
202 | _u53c2_u6570b = 23 | ||
203 | end | ||
204 | return _u6253_u5370("什么") | ||
205 | end | ||
206 | _u591a_u53c2_u6570 = function(_u53c2_u6570f, _u53c2_u6570g, _u53c2_u6570m, _u53c2_u6570a, _u53c2_u6570b) | ||
207 | if _u53c2_u6570a == nil then | ||
208 | _u53c2_u6570a = "hi" | ||
209 | end | ||
210 | if _u53c2_u6570b == nil then | ||
211 | _u53c2_u6570b = 23 | ||
212 | end | ||
213 | return _u6253_u5370("什么") | ||
214 | end | ||
215 | local self | ||
216 | self = function(_u53c2_u6570n) | ||
217 | if _u53c2_u6570n == 0 then | ||
218 | return 1 | ||
219 | end | ||
220 | return _u53c2_u6570n * self(_u53c2_u6570n - 1) | ||
221 | end | ||
222 | return nil | ||
diff --git a/spec/outputs/unicode/global.lua b/spec/outputs/unicode/global.lua new file mode 100644 index 0000000..c91db52 --- /dev/null +++ b/spec/outputs/unicode/global.lua | |||
@@ -0,0 +1,91 @@ | |||
1 | do | ||
2 | _u5168_u5c40_u53d8_u91cfa, _u5168_u5c40_u53d8_u91cfb, _u5168_u5c40_u53d8_u91cfc = 223, 343, nil | ||
3 | _u9177 = "📉" | ||
4 | end | ||
5 | do | ||
6 | do | ||
7 | local _class_0 | ||
8 | local _base_0 = { | ||
9 | ["嗯"] = "🆒" | ||
10 | } | ||
11 | if _base_0.__index == nil then | ||
12 | _base_0.__index = _base_0 | ||
13 | end | ||
14 | _class_0 = setmetatable({ | ||
15 | __init = function() end, | ||
16 | __base = _base_0, | ||
17 | __name = "全局类" | ||
18 | }, { | ||
19 | __index = _base_0, | ||
20 | __call = function(cls, ...) | ||
21 | local _self_0 = setmetatable({ }, _base_0) | ||
22 | cls.__init(_self_0, ...) | ||
23 | return _self_0 | ||
24 | end | ||
25 | }) | ||
26 | _base_0.__class = _class_0 | ||
27 | _u5168_u5c40_u7c7b = _class_0 | ||
28 | end | ||
29 | end | ||
30 | do | ||
31 | local _u53d8_u91cfc, _u53d8_u91cfd | ||
32 | _u5168_u5c40_u53d8_u91cfa, _u5168_u5c40_u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd = "你好", nil, nil, nil | ||
33 | end | ||
34 | do | ||
35 | local _u4ec0_u4e48 | ||
36 | if _u8fd9_u4e2a then | ||
37 | _u4ec0_u4e48 = 232 | ||
38 | else | ||
39 | _u4ec0_u4e48 = 4343 | ||
40 | end | ||
41 | local _u53e6_u4e00_u4e2a = 3434 | ||
42 | A_u53e6_u4e00_u4e2a = 7890 | ||
43 | if _u5185_u90e8 then | ||
44 | local Y_u597d = "10000" | ||
45 | end | ||
46 | if _u8fd9_u4e2a then | ||
47 | _u4ec0_u4e48 = 232 | ||
48 | else | ||
49 | _u4ec0_u4e48 = 4343 | ||
50 | end | ||
51 | end | ||
52 | do | ||
53 | if _u8fd9_u4e2a then | ||
54 | _u4ec0_u4e48 = 232 | ||
55 | else | ||
56 | _u4ec0_u4e48 = 4343 | ||
57 | end | ||
58 | _u5168_u5c40_u53d8_u91cfx, _u5168_u5c40_u53d8_u91cfy, _u5168_u5c40_u53d8_u91cfz = 1, 2, 3 | ||
59 | _u5168_u5c40_u53d8_u91cfy = function() | ||
60 | local _u597d_u7684 = 3434 | ||
61 | end | ||
62 | do | ||
63 | local _with_0 = _u5168_u5c40_u4e34_u65f6_u53d8_u91cf | ||
64 | local _u53d8_u91cfj = 2000 | ||
65 | end | ||
66 | end | ||
67 | do | ||
68 | _u53d8_u91cfx = 3434 | ||
69 | if _u6761_u4ef6y then | ||
70 | _u53d8_u91cfx = 10 | ||
71 | end | ||
72 | end | ||
73 | do | ||
74 | if _u6761_u4ef6y then | ||
75 | local _u53d8_u91cfx = 10 | ||
76 | end | ||
77 | _u53d8_u91cfx = 3434 | ||
78 | end | ||
79 | do | ||
80 | do | ||
81 | _u53d8_u91cfk = 1212 | ||
82 | do | ||
83 | local _u53d8_u91cfh = 100 | ||
84 | end | ||
85 | _u5168_u5c40_u53d8_u91cfy = function() | ||
86 | local _u53d8_u91cfh = 100 | ||
87 | _u53d8_u91cfk = 100 | ||
88 | end | ||
89 | end | ||
90 | local _u53d8_u91cfh = 100 | ||
91 | end | ||
diff --git a/spec/outputs/unicode/goto.lua b/spec/outputs/unicode/goto.lua new file mode 100644 index 0000000..8e2e5a6 --- /dev/null +++ b/spec/outputs/unicode/goto.lua | |||
@@ -0,0 +1,67 @@ | |||
1 | do | ||
2 | local _u53d8_u91cfa = 0 | ||
3 | ::_u5f00_u59cb:: | ||
4 | _u53d8_u91cfa = _u53d8_u91cfa + 1 | ||
5 | if _u53d8_u91cfa == 5 then | ||
6 | goto _u7ed3_u675f | ||
7 | end | ||
8 | goto _u5f00_u59cb | ||
9 | ::_u7ed3_u675f:: | ||
10 | end | ||
11 | do | ||
12 | for _u8ba1_u6570z = 1, 10 do | ||
13 | for _u8ba1_u6570y = 1, 10 do | ||
14 | for _u8ba1_u6570x = 1, 10 do | ||
15 | if _u8ba1_u6570x ^ 2 + _u8ba1_u6570y ^ 2 == _u8ba1_u6570z ^ 2 then | ||
16 | _u6253_u5370('找到了毕达哥拉斯三元组:', _u8ba1_u6570x, _u8ba1_u6570y, _u8ba1_u6570z) | ||
17 | goto _u5b8c_u6210 | ||
18 | end | ||
19 | end | ||
20 | end | ||
21 | end | ||
22 | ::_u5b8c_u6210:: | ||
23 | end | ||
24 | do | ||
25 | for _u8ba1_u6570z = 1, 10 do | ||
26 | for _u8ba1_u6570y = 1, 10 do | ||
27 | for _u8ba1_u6570x = 1, 10 do | ||
28 | if _u8ba1_u6570x ^ 2 + _u8ba1_u6570y ^ 2 == _u8ba1_u6570z ^ 2 then | ||
29 | _u6253_u5370('找到了毕达哥拉斯三元组:', _u8ba1_u6570x, _u8ba1_u6570y, _u8ba1_u6570z) | ||
30 | _u6253_u5370('now trying next z...') | ||
31 | goto _u7ee7_u7eedz | ||
32 | end | ||
33 | end | ||
34 | end | ||
35 | ::_u7ee7_u7eedz:: | ||
36 | end | ||
37 | end | ||
38 | do | ||
39 | ::_u91cd_u505a:: | ||
40 | for _u8ba1_u6570x = 1, 10 do | ||
41 | for _u8ba1_u6570y = 1, 10 do | ||
42 | if not _u51fd_u6570f(_u8ba1_u6570x, _u8ba1_u6570y) then | ||
43 | goto _u7ee7_u7eed | ||
44 | end | ||
45 | if not _u51fd_u6570g(_u8ba1_u6570x, _u8ba1_u6570y) then | ||
46 | goto _u8df3_u8fc7 | ||
47 | end | ||
48 | if not _u51fd_u6570h(_u8ba1_u6570x, _u8ba1_u6570y) then | ||
49 | goto _u91cd_u505a | ||
50 | end | ||
51 | ::_u7ee7_u7eed:: | ||
52 | end | ||
53 | end | ||
54 | ::_u8df3_u8fc7:: | ||
55 | end | ||
56 | do | ||
57 | local _list_0 = _u5217_u8868 | ||
58 | for _index_0 = 1, #_list_0 do | ||
59 | local _u53d8_u91cf = _list_0[_index_0] | ||
60 | if _u53d8_u91cf % 2 == 0 then | ||
61 | _u6253_u5370('列表有偶数') | ||
62 | goto _u6709 | ||
63 | end | ||
64 | end | ||
65 | _u6253_u5370('列表没偶数') | ||
66 | ::_u6709:: | ||
67 | end | ||
diff --git a/spec/outputs/unicode/import.lua b/spec/outputs/unicode/import.lua new file mode 100644 index 0000000..50acc11 --- /dev/null +++ b/spec/outputs/unicode/import.lua | |||
@@ -0,0 +1,112 @@ | |||
1 | local _u4f60_u597d = _u597d_u7684["你好"] | ||
2 | local _u597d_u5440, _u4e16_u754c | ||
3 | do | ||
4 | local _obj_0 = _u8868["酷"] | ||
5 | _u597d_u5440, _u4e16_u754c = _obj_0["好呀"], _obj_0["世界"] | ||
6 | end | ||
7 | local _u5b57_u6bb5x, _u5b57_u6bb5y, _u5b57_u6bb5z = _u9053_u5177_u7ec4["字段x"], (function() | ||
8 | local _base_0 = _u9053_u5177_u7ec4 | ||
9 | local _fn_0 = _base_0["字段y"] | ||
10 | return _fn_0 and function(...) | ||
11 | return _fn_0(_base_0, ...) | ||
12 | end | ||
13 | end)(), _u9053_u5177_u7ec4["字段z"] | ||
14 | local _u9886_u4e3b, _ud83d_udc7b | ||
15 | do | ||
16 | local _obj_0 = _u627e_u5230("我的表") | ||
17 | _u9886_u4e3b, _ud83d_udc7b = _obj_0["领主"], (function() | ||
18 | local _base_0 = _obj_0 | ||
19 | local _fn_0 = _base_0["👻"] | ||
20 | return _fn_0 and function(...) | ||
21 | return _fn_0(_base_0, ...) | ||
22 | end | ||
23 | end)() | ||
24 | end | ||
25 | local _obj_0 = 232 | ||
26 | local _u67d0_u7269 | ||
27 | do | ||
28 | local _obj_1 = _u4e00_u4e2a(_u8868_u683c) | ||
29 | _u67d0_u7269 = _obj_1["某物"] | ||
30 | end | ||
31 | if _u7f29_u8fdb then | ||
32 | local _u597d_u5427, _u5f88_u597d | ||
33 | do | ||
34 | local _obj_1 = _u5f88_u591a_u8868[100] | ||
35 | _u597d_u5427, _u5f88_u597d = _obj_1["好吧"], (function() | ||
36 | local _base_0 = _obj_1 | ||
37 | local _fn_0 = _base_0["很好"] | ||
38 | return _fn_0 and function(...) | ||
39 | return _fn_0(_base_0, ...) | ||
40 | end | ||
41 | end)() | ||
42 | end | ||
43 | end | ||
44 | do | ||
45 | local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] | ||
46 | end | ||
47 | do | ||
48 | local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] | ||
49 | end | ||
50 | do | ||
51 | local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] | ||
52 | end | ||
53 | do | ||
54 | local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] | ||
55 | end | ||
56 | do | ||
57 | local _u5b57_u6bb5a, _u5b57_u6bb5b, _u5b57_u6bb5c = _u5bf9_u8c61z["字段a"], _u5bf9_u8c61z["字段b"], _u5bf9_u8c61z["字段c"] | ||
58 | end | ||
59 | do | ||
60 | local _u6a21_u5757 = require('模块') | ||
61 | _u6253_u5370(_u6a21_u5757) | ||
62 | local _u6a21_u5757_x = require('模块_x') | ||
63 | _u6253_u5370(_u6a21_u5757_x) | ||
64 | local _u4e0b__u5212__u7ebf__u6a21__u5757__u554a = require("下-划-线-模-块-啊") | ||
65 | _u6253_u5370(_u4e0b__u5212__u7ebf__u6a21__u5757__u554a) | ||
66 | local _u5b50_u6a21_u5757 = require("模块.子模块") | ||
67 | _u6253_u5370(_u5b50_u6a21_u5757) | ||
68 | end | ||
69 | do | ||
70 | local _u5927_u73a9_u5bb6 = require("小玩家") | ||
71 | local C, Ct, Cmt | ||
72 | do | ||
73 | local _obj_1 = require("lpeg库") | ||
74 | C, Ct, Cmt = _obj_1.C, _obj_1.Ct, _obj_1.Cmt | ||
75 | end | ||
76 | local _u4e00, _u4e8c, _u5b57_u7b26 | ||
77 | do | ||
78 | local _obj_1 = require("导出") | ||
79 | _u4e00, _u4e8c, _u5b57_u7b26 = _obj_1[1], _obj_1[2], _obj_1["某键"]["嗯"][1] | ||
80 | end | ||
81 | local _u53c8_u4e00_u4e2a_u7ec4_u4ef6 = require("导出")["又一个组件"] | ||
82 | _u6253_u5370(_u53c8_u4e00_u4e2a_u7ec4_u4ef6) | ||
83 | end | ||
84 | do | ||
85 | _u6a21_u5757 = require('模块') | ||
86 | _u6a21_u5757_x = require('模块_x') | ||
87 | _u6a21_u5757_y = require("组织.包.模块-y") | ||
88 | _u6253_u5370(_u6a21_u5757_y) | ||
89 | end | ||
90 | do | ||
91 | local _u51fd_u6570, _u5982_u679c_u53d8_u91cf | ||
92 | do | ||
93 | local _obj_1 = require("组织.包.模块") | ||
94 | _u51fd_u6570, _u5982_u679c_u53d8_u91cf = _obj_1["函数体"], _obj_1["如果"] | ||
95 | end | ||
96 | end | ||
97 | do | ||
98 | local _u53d8_u91cfb = getmetatable(require("块")).__gc | ||
99 | local index = getmetatable(require("块")).__index | ||
100 | local _u53d8_u91cff, _u53d8_u91cfc | ||
101 | do | ||
102 | local _obj_1 = require("块") | ||
103 | _u53d8_u91cff = _obj_1["字段e"] | ||
104 | _u53d8_u91cfc = getmetatable(_obj_1).__pairs | ||
105 | end | ||
106 | local _u53d8_u91cfd = require("块")["字段c"] | ||
107 | local _u5143_u7d20g, _u53d8_u91cfi | ||
108 | do | ||
109 | local _obj_1 = require("块") | ||
110 | _u5143_u7d20g, _u53d8_u91cfi = _obj_1[1], getmetatable(_obj_1[2]).__close | ||
111 | end | ||
112 | end | ||
diff --git a/spec/outputs/unicode/in_expression.lua b/spec/outputs/unicode/in_expression.lua new file mode 100644 index 0000000..62aad05 --- /dev/null +++ b/spec/outputs/unicode/in_expression.lua | |||
@@ -0,0 +1,181 @@ | |||
1 | _u51fd_u6570((function() | ||
2 | local _val_0 = -_u53d8_u91cfa ^ 2 | ||
3 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
4 | end)()) | ||
5 | local _u53d8_u91cfa, _u53d8_u91cfb = (function(...) | ||
6 | local _val_0 = _u51fd_u6570x(...) | ||
7 | return not (1 <= _val_0 and _val_0 <= 3) | ||
8 | end)(...), 2 | ||
9 | local _u53d8_u91cfd | ||
10 | do | ||
11 | local _val_0 = (_u5bf9_u8c61["字段x"]["字段y"](...)) | ||
12 | _u53d8_u91cfd = not (1 <= _val_0 and _val_0 <= 3) | ||
13 | end | ||
14 | local _u5728_u7684 | ||
15 | do | ||
16 | local _val_0 = "东" | ||
17 | _u5728_u7684 = "东" == _val_0 or "西" == _val_0 | ||
18 | end | ||
19 | if (1 == _u53d8_u91cfa) and (2 == _u53d8_u91cfb or 3 == _u53d8_u91cfb or 4 == _u53d8_u91cfb) or (function() | ||
20 | local _val_0 = _u53d8_u91cfc | ||
21 | return 1 <= _val_0 and _val_0 <= 10 | ||
22 | end)() then | ||
23 | _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc) | ||
24 | end | ||
25 | do | ||
26 | local _exp_0 = _u503c | ||
27 | if 1 == _exp_0 or 2 == _exp_0 or 3 == _exp_0 then | ||
28 | _u6253_u5370("1, 2, 3") | ||
29 | elseif not (0 < _exp_0 and _exp_0 <= 100) then | ||
30 | _u6253_u5370("非 (0 < 值 <= 100)") | ||
31 | elseif (200 <= _exp_0 and _exp_0 < 300) then | ||
32 | _u6253_u5370("200 <= 值 < 300)") | ||
33 | elseif not (333 == _exp_0 or 444 == _exp_0 or 555 == _exp_0) then | ||
34 | _u6253_u5370("非 333, 444 或 555") | ||
35 | end | ||
36 | end | ||
37 | do | ||
38 | local _val_0 = _u53d8_u91cfy | ||
39 | return not (_u5f00_u59cb < _val_0 and _val_0 < _u7ed3_u675f) | ||
40 | end | ||
41 | do | ||
42 | local _u5b58_u5728 | ||
43 | do | ||
44 | local _check_0 = _u8868 | ||
45 | local _val_0 = _u5143_u7d20 | ||
46 | local _find_0 = false | ||
47 | for _index_0 = 1, #_check_0 do | ||
48 | local _item_0 = _check_0[_index_0] | ||
49 | if _item_0 == _val_0 then | ||
50 | _find_0 = true | ||
51 | break | ||
52 | end | ||
53 | end | ||
54 | _u5b58_u5728 = _find_0 | ||
55 | end | ||
56 | _u68c0_u67e5((function() | ||
57 | local _check_0 = _u8868 | ||
58 | local _val_0 = _u5143_u7d20 | ||
59 | for _index_0 = 1, #_check_0 do | ||
60 | if _check_0[_index_0] == _val_0 then | ||
61 | return true | ||
62 | end | ||
63 | end | ||
64 | return false | ||
65 | end)()) | ||
66 | end | ||
67 | do | ||
68 | local _u5bf9_u8c61 = _u83b7_u53d6() | ||
69 | local _u5b58_u5728 | ||
70 | do | ||
71 | local _check_0 = _u8868 | ||
72 | local _val_0 = _u5143_u7d20 | ||
73 | local _find_0 = false | ||
74 | for _index_0 = 1, #_check_0 do | ||
75 | local _item_0 = _check_0[_index_0] | ||
76 | if _item_0 == _val_0 then | ||
77 | _find_0 = true | ||
78 | break | ||
79 | end | ||
80 | end | ||
81 | _u5b58_u5728 = _find_0 | ||
82 | end | ||
83 | _u68c0_u67e5((function() | ||
84 | local _check_0 = _u8868 | ||
85 | local _val_0 = _u5143_u7d20 | ||
86 | for _index_0 = 1, #_check_0 do | ||
87 | if _check_0[_index_0] == _val_0 then | ||
88 | return true | ||
89 | end | ||
90 | end | ||
91 | return false | ||
92 | end)()) | ||
93 | end | ||
94 | do | ||
95 | local _u5bf9_u8c61 = _u83b7_u53d6() | ||
96 | local _u5217_u8868 = { | ||
97 | 1, | ||
98 | 2, | ||
99 | 3 | ||
100 | } | ||
101 | local _u4e0d_u5b58_u5728 | ||
102 | do | ||
103 | local _val_0 = _u5143_u7d20 | ||
104 | local _find_0 = false | ||
105 | for _index_0 = 1, #_u5217_u8868 do | ||
106 | local _item_0 = _u5217_u8868[_index_0] | ||
107 | if _item_0 == _val_0 then | ||
108 | _find_0 = true | ||
109 | break | ||
110 | end | ||
111 | end | ||
112 | _u4e0d_u5b58_u5728 = not _find_0 | ||
113 | end | ||
114 | _u68c0_u67e5((function() | ||
115 | local _val_0 = _u5143_u7d20 | ||
116 | for _index_0 = 1, #_u5217_u8868 do | ||
117 | if _u5217_u8868[_index_0] == _val_0 then | ||
118 | return true | ||
119 | end | ||
120 | end | ||
121 | return false | ||
122 | end)()) | ||
123 | _u68c0_u67e5((function() | ||
124 | local _val_0 = _u5143_u7d20 | ||
125 | return 1 == _val_0 or 2 == _val_0 or 3 == _val_0 | ||
126 | end)()) | ||
127 | _u68c0_u67e5((function(...) | ||
128 | local _check_0 = { | ||
129 | [1] = 1, | ||
130 | [2] = 2, | ||
131 | [3] = 3 | ||
132 | } | ||
133 | local _val_0 = _u5143_u7d20(...) | ||
134 | for _index_0 = 1, #_check_0 do | ||
135 | if _check_0[_index_0] == _val_0 then | ||
136 | return true | ||
137 | end | ||
138 | end | ||
139 | return false | ||
140 | end)(...)) | ||
141 | end | ||
142 | do | ||
143 | _u68c0_u67e5(function() | ||
144 | local _check_0 = _u6570_u7ec4tb | ||
145 | local _val_0 = _u5bf9_u8c61x | ||
146 | for _index_0 = 1, #_check_0 do | ||
147 | if _check_0[_index_0] == _val_0 then | ||
148 | return true | ||
149 | end | ||
150 | end | ||
151 | return false | ||
152 | end) | ||
153 | _u68c0_u67e5(function() | ||
154 | local _check_0 = _u6570_u7ec4tb | ||
155 | local _val_0 = _u5bf9_u8c61x | ||
156 | for _index_0 = 1, #_check_0 do | ||
157 | if _check_0[_index_0] == _val_0 then | ||
158 | return false | ||
159 | end | ||
160 | end | ||
161 | return true | ||
162 | end) | ||
163 | local _u5bf9_u8c61x, _u6570_u7ec4tb | ||
164 | _u68c0_u67e5(function() | ||
165 | for _index_0 = 1, #_u6570_u7ec4tb do | ||
166 | if _u6570_u7ec4tb[_index_0] == _u5bf9_u8c61x then | ||
167 | return true | ||
168 | end | ||
169 | end | ||
170 | return false | ||
171 | end) | ||
172 | _u68c0_u67e5(function() | ||
173 | for _index_0 = 1, #_u6570_u7ec4tb do | ||
174 | if _u6570_u7ec4tb[_index_0] == _u5bf9_u8c61x then | ||
175 | return false | ||
176 | end | ||
177 | end | ||
178 | return true | ||
179 | end) | ||
180 | end | ||
181 | return nil | ||
diff --git a/spec/outputs/unicode/lists.lua b/spec/outputs/unicode/lists.lua new file mode 100644 index 0000000..aafd516 --- /dev/null +++ b/spec/outputs/unicode/lists.lua | |||
@@ -0,0 +1,281 @@ | |||
1 | local _u4f60_u597d | ||
2 | do | ||
3 | local _accum_0 = { } | ||
4 | local _len_0 = 1 | ||
5 | for _, _u53d8_u91cfx in ipairs({ | ||
6 | 1, | ||
7 | 2, | ||
8 | 3, | ||
9 | 4 | ||
10 | }) do | ||
11 | _accum_0[_len_0] = _u53d8_u91cfx * 2 | ||
12 | _len_0 = _len_0 + 1 | ||
13 | end | ||
14 | _u4f60_u597d = _accum_0 | ||
15 | end | ||
16 | local _u7269_u54c1 = { | ||
17 | 1, | ||
18 | 2, | ||
19 | 3, | ||
20 | 4, | ||
21 | 5, | ||
22 | 6 | ||
23 | } | ||
24 | local _ | ||
25 | do | ||
26 | local _accum_0 = { } | ||
27 | local _len_0 = 1 | ||
28 | for _u53d8_u91cfz in ipairs(_u7269_u54c1) do | ||
29 | if _u53d8_u91cfz > 4 then | ||
30 | _accum_0[_len_0] = _u53d8_u91cfz | ||
31 | _len_0 = _len_0 + 1 | ||
32 | end | ||
33 | end | ||
34 | _ = _accum_0 | ||
35 | end | ||
36 | local _u534a_u5f84 | ||
37 | do | ||
38 | local _accum_0 = { } | ||
39 | local _len_0 = 1 | ||
40 | for _u53d8_u91cfa in ipairs({ | ||
41 | 1, | ||
42 | 2, | ||
43 | 3, | ||
44 | 4, | ||
45 | 5, | ||
46 | 6 | ||
47 | }) do | ||
48 | if _u597d_u6570_u5b57(_u53d8_u91cfa) then | ||
49 | _accum_0[_len_0] = { | ||
50 | _u53d8_u91cfa | ||
51 | } | ||
52 | _len_0 = _len_0 + 1 | ||
53 | end | ||
54 | end | ||
55 | _u534a_u5f84 = _accum_0 | ||
56 | end | ||
57 | do | ||
58 | local _accum_0 = { } | ||
59 | local _len_0 = 1 | ||
60 | for _u53d8_u91cfz in _u7269_u54c1 do | ||
61 | for _u53d8_u91cfj in _u5217_u8868 do | ||
62 | if _u53d8_u91cfz > 4 then | ||
63 | _accum_0[_len_0] = _u53d8_u91cfz | ||
64 | _len_0 = _len_0 + 1 | ||
65 | end | ||
66 | end | ||
67 | end | ||
68 | _ = _accum_0 | ||
69 | end | ||
70 | require("实用") | ||
71 | local _u503e_u5012 | ||
72 | _u503e_u5012 = function(_u53d8_u91cfx) | ||
73 | return _u6253_u5370(_u5b9e_u7528["倾倒"](_u53d8_u91cfx)) | ||
74 | end | ||
75 | local _u8303_u56f4 | ||
76 | _u8303_u56f4 = function(_u6570_u91cf) | ||
77 | local _u53d8_u91cfi = 0 | ||
78 | return coroutine.wrap(function() | ||
79 | while _u53d8_u91cfi < _u6570_u91cf do | ||
80 | coroutine.yield(_u53d8_u91cfi) | ||
81 | _u53d8_u91cfi = _u53d8_u91cfi + 1 | ||
82 | end | ||
83 | end) | ||
84 | end | ||
85 | _u503e_u5012((function() | ||
86 | local _accum_0 = { } | ||
87 | local _len_0 = 1 | ||
88 | for _u53d8_u91cfx in _u8303_u56f4(10) do | ||
89 | _accum_0[_len_0] = _u53d8_u91cfx | ||
90 | _len_0 = _len_0 + 1 | ||
91 | end | ||
92 | return _accum_0 | ||
93 | end)()) | ||
94 | _u503e_u5012((function() | ||
95 | local _accum_0 = { } | ||
96 | local _len_0 = 1 | ||
97 | for _u53d8_u91cfx in _u8303_u56f4(5) do | ||
98 | if _u53d8_u91cfx > 2 then | ||
99 | for _u53d8_u91cfy in _u8303_u56f4(5) do | ||
100 | _accum_0[_len_0] = { | ||
101 | _u53d8_u91cfx, | ||
102 | _u53d8_u91cfy | ||
103 | } | ||
104 | _len_0 = _len_0 + 1 | ||
105 | end | ||
106 | end | ||
107 | end | ||
108 | return _accum_0 | ||
109 | end)()) | ||
110 | local _u4e1c_u897f | ||
111 | do | ||
112 | local _accum_0 = { } | ||
113 | local _len_0 = 1 | ||
114 | for _u53d8_u91cfx in _u8303_u56f4(10) do | ||
115 | if _u53d8_u91cfx > 5 then | ||
116 | for _u53d8_u91cfy in _u8303_u56f4(10) do | ||
117 | if _u53d8_u91cfy > 7 then | ||
118 | _accum_0[_len_0] = _u53d8_u91cfx + _u53d8_u91cfy | ||
119 | _len_0 = _len_0 + 1 | ||
120 | end | ||
121 | end | ||
122 | end | ||
123 | end | ||
124 | _u4e1c_u897f = _accum_0 | ||
125 | end | ||
126 | for _u53d8_u91cfx in ipairs({ | ||
127 | 1, | ||
128 | 2, | ||
129 | 4 | ||
130 | }) do | ||
131 | for _u53d8_u91cfy in ipairs({ | ||
132 | 1, | ||
133 | 2, | ||
134 | 3 | ||
135 | }) do | ||
136 | if _u53d8_u91cfx ~= 2 then | ||
137 | _u6253_u5370(_u53d8_u91cfx, _u53d8_u91cfy) | ||
138 | end | ||
139 | end | ||
140 | end | ||
141 | for _u53d8_u91cfx in _u7269_u54c1 do | ||
142 | _u6253_u5370("你好", _u53d8_u91cfx) | ||
143 | end | ||
144 | do | ||
145 | local _accum_0 = { } | ||
146 | local _len_0 = 1 | ||
147 | for _u53d8_u91cfx in _u53d8_u91cfx do | ||
148 | _accum_0[_len_0] = _u53d8_u91cfx | ||
149 | _len_0 = _len_0 + 1 | ||
150 | end | ||
151 | _ = _accum_0 | ||
152 | end | ||
153 | local _u53d8_u91cfx | ||
154 | do | ||
155 | local _accum_0 = { } | ||
156 | local _len_0 = 1 | ||
157 | for _u53d8_u91cfx in _u53d8_u91cfx do | ||
158 | _accum_0[_len_0] = _u53d8_u91cfx | ||
159 | _len_0 = _len_0 + 1 | ||
160 | end | ||
161 | _u53d8_u91cfx = _accum_0 | ||
162 | end | ||
163 | for _u53d8_u91cfx in ipairs({ | ||
164 | 1, | ||
165 | 2, | ||
166 | 4 | ||
167 | }) do | ||
168 | for _u53d8_u91cfy in ipairs({ | ||
169 | 1, | ||
170 | 2, | ||
171 | 3 | ||
172 | }) do | ||
173 | if _u53d8_u91cfx ~= 2 then | ||
174 | _u6253_u5370(_u53d8_u91cfx, _u53d8_u91cfy) | ||
175 | end | ||
176 | end | ||
177 | end | ||
178 | local _u53cc_u500d | ||
179 | do | ||
180 | local _accum_0 = { } | ||
181 | local _len_0 = 1 | ||
182 | for _index_0 = 1, #_u7269_u54c1 do | ||
183 | local _u53d8_u91cfx = _u7269_u54c1[_index_0] | ||
184 | _accum_0[_len_0] = _u53d8_u91cfx * 2 | ||
185 | _len_0 = _len_0 + 1 | ||
186 | end | ||
187 | _u53cc_u500d = _accum_0 | ||
188 | end | ||
189 | for _index_0 = 1, #_u53cc_u500d do | ||
190 | local _u53d8_u91cfx = _u53cc_u500d[_index_0] | ||
191 | _u6253_u5370(_u53d8_u91cfx) | ||
192 | end | ||
193 | local _u5207 | ||
194 | do | ||
195 | local _accum_0 = { } | ||
196 | local _len_0 = 1 | ||
197 | for _index_0 = 1, #_u7269_u54c1 do | ||
198 | local _u53d8_u91cfx = _u7269_u54c1[_index_0] | ||
199 | if _u53d8_u91cfx > 3 then | ||
200 | _accum_0[_len_0] = _u53d8_u91cfx | ||
201 | _len_0 = _len_0 + 1 | ||
202 | end | ||
203 | end | ||
204 | _u5207 = _accum_0 | ||
205 | end | ||
206 | do | ||
207 | local _accum_0 = { } | ||
208 | local _len_0 = 1 | ||
209 | for _index_0 = 1, #_u7269_u54c1 do | ||
210 | local _u53d8_u91cfx = _u7269_u54c1[_index_0] | ||
211 | for _index_1 = 1, #_u7269_u54c1 do | ||
212 | local _u53d8_u91cfy = _u7269_u54c1[_index_1] | ||
213 | _accum_0[_len_0] = _u53d8_u91cfx + _u53d8_u91cfy | ||
214 | _len_0 = _len_0 + 1 | ||
215 | end | ||
216 | end | ||
217 | _u4f60_u597d = _accum_0 | ||
218 | end | ||
219 | for _index_0 = 1, #_u4f60_u597d do | ||
220 | local _u53d8_u91cfz = _u4f60_u597d[_index_0] | ||
221 | _u6253_u5370(_u53d8_u91cfz) | ||
222 | end | ||
223 | _u53d8_u91cfx = { | ||
224 | 1, | ||
225 | 2, | ||
226 | 3, | ||
227 | 4, | ||
228 | 5, | ||
229 | 6, | ||
230 | 7 | ||
231 | } | ||
232 | local _max_0 = -5 | ||
233 | for _index_0 = 2, _max_0 < 0 and #_u53d8_u91cfx + _max_0 or _max_0, 2 do | ||
234 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
235 | _u6253_u5370(_u53d8_u91cfy) | ||
236 | end | ||
237 | local _max_1 = 3 | ||
238 | for _index_0 = 1, _max_1 < 0 and #_u53d8_u91cfx + _max_1 or _max_1 do | ||
239 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
240 | _u6253_u5370(_u53d8_u91cfy) | ||
241 | end | ||
242 | for _index_0 = 2, #_u53d8_u91cfx do | ||
243 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
244 | _u6253_u5370(_u53d8_u91cfy) | ||
245 | end | ||
246 | for _index_0 = 1, #_u53d8_u91cfx, 2 do | ||
247 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
248 | _u6253_u5370(_u53d8_u91cfy) | ||
249 | end | ||
250 | for _index_0 = 2, #_u53d8_u91cfx, 2 do | ||
251 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
252 | _u6253_u5370(_u53d8_u91cfy) | ||
253 | end | ||
254 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = 1, 5, 2 | ||
255 | local _max_2 = _u53d8_u91cfb | ||
256 | for _index_0 = _u53d8_u91cfa, _max_2 < 0 and #_u53d8_u91cfx + _max_2 or _max_2, _u53d8_u91cfc do | ||
257 | local _u53d8_u91cfy = _u53d8_u91cfx[_index_0] | ||
258 | _u6253_u5370(_u53d8_u91cfy) | ||
259 | end | ||
260 | local _u6b63_u5e38 | ||
261 | _u6b63_u5e38 = function(_u4f60_u597d) | ||
262 | local _accum_0 = { } | ||
263 | local _len_0 = 1 | ||
264 | for _u53d8_u91cfx in _u55ef_u54fc do | ||
265 | _accum_0[_len_0] = _u53d8_u91cfx | ||
266 | _len_0 = _len_0 + 1 | ||
267 | end | ||
268 | return _accum_0 | ||
269 | end | ||
270 | local _u6d4b_u8bd5 = _u53d8_u91cfx(1, 2, 3, 4, 5) | ||
271 | for _index_0 = 1, #_u6d4b_u8bd5 do | ||
272 | local _u4e8b_u60c5 = _u6d4b_u8bd5[_index_0] | ||
273 | _u6253_u5370(_u4e8b_u60c5) | ||
274 | end | ||
275 | return function() | ||
276 | local _list_0 = _u884c_u4eec | ||
277 | for _index_0 = 1, #_list_0 do | ||
278 | local _u884c = _list_0[_index_0] | ||
279 | _u53d8_u91cfa = _u53d8_u91cfb | ||
280 | end | ||
281 | end | ||
diff --git a/spec/outputs/unicode/literals.lua b/spec/outputs/unicode/literals.lua new file mode 100644 index 0000000..ccd32f1 --- /dev/null +++ b/spec/outputs/unicode/literals.lua | |||
@@ -0,0 +1,36 @@ | |||
1 | local _u6570_u636e = { | ||
2 | 121, | ||
3 | 121.2323, | ||
4 | 121.2323e-1, | ||
5 | 121.2323e13434, | ||
6 | 2323E34, | ||
7 | 0x12323, | ||
8 | 0xfF2323, | ||
9 | 0xabcdef, | ||
10 | 0xABCDEF, | ||
11 | 0x123p-123, | ||
12 | 0xABCP+321, | ||
13 | 0x.1p-111, | ||
14 | 0xABCP-321, | ||
15 | .2323, | ||
16 | .2323e-1, | ||
17 | .2323e13434, | ||
18 | 1LL, | ||
19 | 1ULL, | ||
20 | 9332LL, | ||
21 | 9332, | ||
22 | 0x2aLL, | ||
23 | 0x2aULL, | ||
24 | 1000000.0000001, | ||
25 | 1234e5678, | ||
26 | 1234E-5678, | ||
27 | 0xDEADBEEF, | ||
28 | [[ 你好 世界 ]], | ||
29 | [=[ 你好 世界 ]=], | ||
30 | [====[ 你好 世界 ]====], | ||
31 | "另一个 世界", | ||
32 | '哪个 世界', | ||
33 | "\n 你好 世界\n ", | ||
34 | '是的\n 发生了什么\n 这里有些很酷的东西' | ||
35 | } | ||
36 | return _u7a7a_u503c | ||
diff --git a/spec/outputs/unicode/local.lua b/spec/outputs/unicode/local.lua new file mode 100644 index 0000000..170144b --- /dev/null +++ b/spec/outputs/unicode/local.lua | |||
@@ -0,0 +1,157 @@ | |||
1 | do | ||
2 | local _u53d8_u91cfa | ||
3 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc | ||
4 | local _u53d8_u91cfg | ||
5 | _u53d8_u91cfb, _u53d8_u91cfg = 23232, nil | ||
6 | end | ||
7 | do | ||
8 | local _u53d8_u91cfx = 1212 | ||
9 | local _u67d0_u4e8b | ||
10 | _u67d0_u4e8b = function() | ||
11 | local _u53d8_u91cfx | ||
12 | _u53d8_u91cfx = 1212 | ||
13 | end | ||
14 | end | ||
15 | do | ||
16 | local _u53d8_u91cfy, _u53d8_u91cfz | ||
17 | _u53d8_u91cfy = 2323 | ||
18 | _u53d8_u91cfz = 2323 | ||
19 | end | ||
20 | do | ||
21 | _u6253_u5370("啥也没有!") | ||
22 | end | ||
23 | do | ||
24 | local X_u5927_u5199, Y_u5927_u5199 | ||
25 | local x_u53d8_u91cf = 3434 | ||
26 | local y_u53d8_u91cf = 3434 | ||
27 | X_u5927_u5199 = 3434 | ||
28 | Y_u5927_u5199 = "好" | ||
29 | end | ||
30 | do | ||
31 | local x_u53d8_u91cf, y_u53d8_u91cf = "a", "b" | ||
32 | end | ||
33 | do | ||
34 | local x_u53d8_u91cf, y_u53d8_u91cf | ||
35 | x_u53d8_u91cf, y_u53d8_u91cf = "a", "b" | ||
36 | end | ||
37 | do | ||
38 | if _u67d0_u4e8b then | ||
39 | local x_u53d8_u91cf = 2323 | ||
40 | end | ||
41 | end | ||
42 | do | ||
43 | local _u53d8_u91cfx | ||
44 | do | ||
45 | _u53d8_u91cfx = "一" | ||
46 | end | ||
47 | _u53d8_u91cfx = 100 | ||
48 | do | ||
49 | _u53d8_u91cfx = "二" | ||
50 | end | ||
51 | end | ||
52 | do | ||
53 | local _u53d8_u91cfk, _u53d8_u91cfx, _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc | ||
54 | if _u4ec0_u4e48 then | ||
55 | _u53d8_u91cfk = 10 | ||
56 | end | ||
57 | _u53d8_u91cfx = 100 | ||
58 | do | ||
59 | local _obj_0 = _u53d8_u91cfy | ||
60 | _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = _obj_0[1], _obj_0[2], _obj_0[3] | ||
61 | end | ||
62 | end | ||
63 | do | ||
64 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd | ||
65 | _u53d8_u91cfa = 100 | ||
66 | _u6253_u5370("嗨") | ||
67 | _u53d8_u91cfb = 200 | ||
68 | _u53d8_u91cfc = 100 | ||
69 | _u6253_u5370("嗨") | ||
70 | _u53d8_u91cfd = 200 | ||
71 | _u53d8_u91cfd = 2323 | ||
72 | end | ||
73 | do | ||
74 | local A_u5927_u5199, O_u4e00, T_u4e8c | ||
75 | local a_u5c0f_u5199 = 5 | ||
76 | A_u5927_u5199 = 3 | ||
77 | do | ||
78 | local _class_0 | ||
79 | local F_u4e94 | ||
80 | local _base_0 = { } | ||
81 | if _base_0.__index == nil then | ||
82 | _base_0.__index = _base_0 | ||
83 | end | ||
84 | _class_0 = setmetatable({ | ||
85 | __init = function() end, | ||
86 | __base = _base_0, | ||
87 | __name = "O一" | ||
88 | }, { | ||
89 | __index = _base_0, | ||
90 | __call = function(cls, ...) | ||
91 | local _self_0 = setmetatable({ }, _base_0) | ||
92 | cls.__init(_self_0, ...) | ||
93 | return _self_0 | ||
94 | end | ||
95 | }) | ||
96 | _base_0.__class = _class_0 | ||
97 | local self = _class_0; | ||
98 | F_u4e94 = 6 | ||
99 | O_u4e00 = _class_0 | ||
100 | end | ||
101 | do | ||
102 | local _class_0 | ||
103 | local N_u65e0 | ||
104 | local _base_0 = { } | ||
105 | if _base_0.__index == nil then | ||
106 | _base_0.__index = _base_0 | ||
107 | end | ||
108 | _class_0 = setmetatable({ | ||
109 | __init = function() end, | ||
110 | __base = _base_0, | ||
111 | __name = "T二" | ||
112 | }, { | ||
113 | __index = _base_0, | ||
114 | __call = function(cls, ...) | ||
115 | local _self_0 = setmetatable({ }, _base_0) | ||
116 | cls.__init(_self_0, ...) | ||
117 | return _self_0 | ||
118 | end | ||
119 | }) | ||
120 | _base_0.__class = _class_0 | ||
121 | local self = _class_0; | ||
122 | do | ||
123 | local _class_1 | ||
124 | local _base_1 = { } | ||
125 | if _base_1.__index == nil then | ||
126 | _base_1.__index = _base_1 | ||
127 | end | ||
128 | _class_1 = setmetatable({ | ||
129 | __init = function() end, | ||
130 | __base = _base_1, | ||
131 | __name = "N无" | ||
132 | }, { | ||
133 | __index = _base_1, | ||
134 | __call = function(cls, ...) | ||
135 | local _self_0 = setmetatable({ }, _base_1) | ||
136 | cls.__init(_self_0, ...) | ||
137 | return _self_0 | ||
138 | end | ||
139 | }) | ||
140 | _base_1.__class = _class_1 | ||
141 | N_u65e0 = _class_1 | ||
142 | end | ||
143 | T_u4e8c = _class_0 | ||
144 | end | ||
145 | end | ||
146 | do | ||
147 | local _list_0 = { } | ||
148 | for _index_0 = 1, #_list_0 do | ||
149 | local _u53d8_u91cfa = _list_0[_index_0] | ||
150 | local _ = _u53d8_u91cfa | ||
151 | end | ||
152 | end | ||
153 | do | ||
154 | local _u53d8_u91cfx | ||
155 | _u53d8_u91cfx = _u53d8_u91cfa or _u53d8_u91cfb | ||
156 | end | ||
157 | local _u53d8_u91cfg = 2323 | ||
diff --git a/spec/outputs/unicode/loops.lua b/spec/outputs/unicode/loops.lua new file mode 100644 index 0000000..d630343 --- /dev/null +++ b/spec/outputs/unicode/loops.lua | |||
@@ -0,0 +1,337 @@ | |||
1 | for _u53d8_u91cfx = 1, 10 do | ||
2 | _u6253_u5370("yeah") | ||
3 | end | ||
4 | for _u53d8_u91cfx = 1, #_u67d0_u7269 do | ||
5 | _u6253_u5370("yeah") | ||
6 | end | ||
7 | for _u53d8_u91cfy = 100, 60, -3 do | ||
8 | _u6253_u5370("倒计时", _u53d8_u91cfy) | ||
9 | end | ||
10 | for _u53d8_u91cfa = 1, 10 do | ||
11 | _u6253_u5370("好的") | ||
12 | end | ||
13 | for _u53d8_u91cfa = 1, 10 do | ||
14 | for _u53d8_u91cfb = 2, 43 do | ||
15 | _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb) | ||
16 | end | ||
17 | end | ||
18 | for _u53d8_u91cfi in _u8fed_u4ee3_u5668 do | ||
19 | for _u53d8_u91cfj in _u662f_u7684 do | ||
20 | local _u53d8_u91cfx = 343 + _u53d8_u91cfi + _u53d8_u91cfj | ||
21 | _u6253_u5370(_u53d8_u91cfi, _u53d8_u91cfj) | ||
22 | end | ||
23 | end | ||
24 | local _list_0 = _u67d0_u7269 | ||
25 | for _index_0 = 1, #_list_0 do | ||
26 | local _u53d8_u91cfx = _list_0[_index_0] | ||
27 | _u6253_u5370(_u53d8_u91cfx) | ||
28 | end | ||
29 | for _u952e, _u503c in pairs(_u4f60_u597d) do | ||
30 | _u6253_u5370(_u952e, _u503c) | ||
31 | end | ||
32 | for _u53d8_u91cfx in _u53d8_u91cfy, _u53d8_u91cfz do | ||
33 | _u6253_u5370(_u53d8_u91cfx) | ||
34 | end | ||
35 | for _u53d8_u91cfx in _u53d8_u91cfy, _u53d8_u91cfz, _u952e do | ||
36 | _u6253_u5370(_u53d8_u91cfx) | ||
37 | end | ||
38 | local _list_1 = _u6a21_u5757 | ||
39 | for _index_0 = 1, #_list_1 do | ||
40 | local _u540d_u79f0, _u6210_u5458_u4eec = _list_1[_index_0] | ||
41 | _u6253_u5370(_u540d_u79f0, _u6210_u5458) | ||
42 | end | ||
43 | local _u53d8_u91cfx | ||
44 | _u53d8_u91cfx = function() | ||
45 | for _u53d8_u91cfx in _u53d8_u91cfy do | ||
46 | local _u53d8_u91cf_ = _u53d8_u91cfy | ||
47 | end | ||
48 | end | ||
49 | local _u4f60_u597d = { | ||
50 | 1, | ||
51 | 2, | ||
52 | 3, | ||
53 | 4, | ||
54 | 5 | ||
55 | } | ||
56 | do | ||
57 | local _accum_0 = { } | ||
58 | local _len_0 = 1 | ||
59 | for _index_0 = 1, #_u4f60_u597d do | ||
60 | local _u53d8_u91cfy = _u4f60_u597d[_index_0] | ||
61 | if _u53d8_u91cfy % 2 == 0 then | ||
62 | _accum_0[_len_0] = _u53d8_u91cfy | ||
63 | end | ||
64 | _len_0 = _len_0 + 1 | ||
65 | end | ||
66 | _u53d8_u91cfx = _accum_0 | ||
67 | end | ||
68 | _u53d8_u91cfx = function() | ||
69 | for _index_0 = 1, #_u4f60_u597d do | ||
70 | local _u53d8_u91cfx = _u4f60_u597d[_index_0] | ||
71 | local _u53d8_u91cf_ = _u53d8_u91cfy | ||
72 | end | ||
73 | end | ||
74 | local _u8868_u683c | ||
75 | do | ||
76 | local _accum_0 = { } | ||
77 | local _len_0 = 1 | ||
78 | for _u53d8_u91cfi = 10, 20 do | ||
79 | _accum_0[_len_0] = _u53d8_u91cfi * 2 | ||
80 | _len_0 = _len_0 + 1 | ||
81 | end | ||
82 | _u8868_u683c = _accum_0 | ||
83 | end | ||
84 | local _u54e6 = 0 | ||
85 | local _u53d8_u91cfy | ||
86 | do | ||
87 | local _accum_0 = { } | ||
88 | local _len_0 = 1 | ||
89 | for _u53d8_u91cfj = 3, 30, 8 do | ||
90 | _u54e6 = _u54e6 + 1 | ||
91 | _accum_0[_len_0] = _u53d8_u91cfj * _u54e6 | ||
92 | _len_0 = _len_0 + 1 | ||
93 | end | ||
94 | _u53d8_u91cfy = _accum_0 | ||
95 | end | ||
96 | local _u53d8_u91cf_ | ||
97 | _u53d8_u91cf_ = function() | ||
98 | for _u53d8_u91cfk = 10, 40 do | ||
99 | _u53d8_u91cf_ = "好的" | ||
100 | end | ||
101 | end | ||
102 | _u53d8_u91cf_ = function() | ||
103 | local _accum_0 = { } | ||
104 | local _len_0 = 1 | ||
105 | for _u53d8_u91cfk = 10, 40 do | ||
106 | _accum_0[_len_0] = "好的" | ||
107 | _len_0 = _len_0 + 1 | ||
108 | end | ||
109 | return _accum_0 | ||
110 | end | ||
111 | while true do | ||
112 | _u6253_u5370("名称") | ||
113 | end | ||
114 | while 5 + 5 do | ||
115 | _u6253_u5370("好的 世界") | ||
116 | _u5de5_u4f5c(_u4eba) | ||
117 | end | ||
118 | while _u8fd8_u6709 do | ||
119 | _u6211(_u4e5f(_u5de5_u4f5c)) | ||
120 | _u53d8_u91cf_ = "好的" | ||
121 | end | ||
122 | local _u53d8_u91cfi = 0 | ||
123 | do | ||
124 | local _accum_0 = { } | ||
125 | local _len_0 = 1 | ||
126 | while _u53d8_u91cfi < 10 do | ||
127 | _u53d8_u91cfi = _u53d8_u91cfi + 1 | ||
128 | _accum_0[_len_0] = _u53d8_u91cfi | ||
129 | _len_0 = _len_0 + 1 | ||
130 | end | ||
131 | _u53d8_u91cfx = _accum_0 | ||
132 | end | ||
133 | do | ||
134 | local _accum_0 = { } | ||
135 | local _len_0 = 1 | ||
136 | local _list_2 = 3 | ||
137 | for _index_0 = 1, #_list_2 do | ||
138 | local _u4e1c_u897f = _list_2[_index_0] | ||
139 | _u53d8_u91cfy = "你好" | ||
140 | break | ||
141 | _len_0 = _len_0 + 1 | ||
142 | end | ||
143 | _u53d8_u91cfx = _accum_0 | ||
144 | end | ||
145 | do | ||
146 | local _accum_0 = { } | ||
147 | local _len_0 = 1 | ||
148 | for _u53d8_u91cfx = 1, 2 do | ||
149 | _u53d8_u91cfy = "你好" | ||
150 | _accum_0[_len_0] = _u53d8_u91cfy | ||
151 | _len_0 = _len_0 + 1 | ||
152 | end | ||
153 | _u53d8_u91cfx = _accum_0 | ||
154 | end | ||
155 | while true do | ||
156 | if false then | ||
157 | goto _continue_0 | ||
158 | end | ||
159 | _u6253_u5370("是的") | ||
160 | if true then | ||
161 | break | ||
162 | end | ||
163 | _u6253_u5370("不") | ||
164 | ::_continue_0:: | ||
165 | end | ||
166 | for _u53d8_u91cfi = 1, 10 do | ||
167 | while true do | ||
168 | if not true then | ||
169 | goto _continue_1 | ||
170 | end | ||
171 | break | ||
172 | ::_continue_1:: | ||
173 | end | ||
174 | end | ||
175 | local _u53d8_u91cfa = 1 | ||
176 | repeat | ||
177 | _u53d8_u91cfa = _u53d8_u91cfa + 1 | ||
178 | if _u53d8_u91cfa == 5 then | ||
179 | goto _continue_2 | ||
180 | end | ||
181 | if _u53d8_u91cfa == 6 then | ||
182 | break | ||
183 | end | ||
184 | _u6253_u5370(_u53d8_u91cfa) | ||
185 | ::_continue_2:: | ||
186 | until _u53d8_u91cfa == 10 | ||
187 | _u53d8_u91cfx = 0 | ||
188 | repeat | ||
189 | _u53d8_u91cfx = _u53d8_u91cfx + 1 | ||
190 | _u53d8_u91cfy = _u53d8_u91cfx | ||
191 | if _u53d8_u91cfx < 5 then | ||
192 | goto _continue_3 | ||
193 | end | ||
194 | _u6253_u5370(_u53d8_u91cfy) | ||
195 | ::_continue_3:: | ||
196 | until _u53d8_u91cfy == 10 | ||
197 | _u53d8_u91cfa = 3 | ||
198 | while not (_u53d8_u91cfa == 0) do | ||
199 | _u53d8_u91cfa = _u53d8_u91cfa - 1 | ||
200 | end | ||
201 | local _u5b8c_u6210 = false | ||
202 | while not _u5b8c_u6210 do | ||
203 | _u5b8c_u6210 = true | ||
204 | end | ||
205 | repeat | ||
206 | _u6253_u5370("你好") | ||
207 | until true | ||
208 | while not _u5b8c_u6210 do | ||
209 | _u53d8_u91cfx = 10 | ||
210 | repeat | ||
211 | _u53d8_u91cfx = _u53d8_u91cfx - 1 | ||
212 | until _u53d8_u91cfx == 0 | ||
213 | end | ||
214 | while not _u6761_u4ef6 do | ||
215 | _u6253_u5370("好的") | ||
216 | end | ||
217 | for _u53d8_u91cfx = 1, 10 do | ||
218 | if _u53d8_u91cfx > 3 and _u53d8_u91cfx < 7 then | ||
219 | goto _continue_4 | ||
220 | end | ||
221 | _u6253_u5370(_u53d8_u91cfx) | ||
222 | ::_continue_4:: | ||
223 | end | ||
224 | local _u5217_u8868 | ||
225 | do | ||
226 | local _accum_0 = { } | ||
227 | local _len_0 = 1 | ||
228 | for _u53d8_u91cfx = 1, 10 do | ||
229 | if _u53d8_u91cfx > 3 and _u53d8_u91cfx < 7 then | ||
230 | goto _continue_5 | ||
231 | end | ||
232 | _accum_0[_len_0] = _u53d8_u91cfx | ||
233 | _len_0 = _len_0 + 1 | ||
234 | ::_continue_5:: | ||
235 | end | ||
236 | _u5217_u8868 = _accum_0 | ||
237 | end | ||
238 | local _list_2 = { | ||
239 | 1, | ||
240 | 2, | ||
241 | 3, | ||
242 | 4, | ||
243 | 5, | ||
244 | 6 | ||
245 | } | ||
246 | for _index_0 = 1, #_list_2 do | ||
247 | local _u53d8_u91cfa = _list_2[_index_0] | ||
248 | if _u53d8_u91cfa == 1 then | ||
249 | goto _continue_6 | ||
250 | end | ||
251 | if _u53d8_u91cfa == 3 then | ||
252 | goto _continue_6 | ||
253 | end | ||
254 | _u6253_u5370(_u53d8_u91cfa) | ||
255 | ::_continue_6:: | ||
256 | end | ||
257 | for _u53d8_u91cfx = 1, 10 do | ||
258 | if _u53d8_u91cfx % 2 == 0 then | ||
259 | goto _continue_7 | ||
260 | end | ||
261 | for _u53d8_u91cfy = 2, 12 do | ||
262 | if _u53d8_u91cfy % 3 == 0 then | ||
263 | goto _continue_8 | ||
264 | end | ||
265 | ::_continue_8:: | ||
266 | end | ||
267 | ::_continue_7:: | ||
268 | end | ||
269 | while true do | ||
270 | if false then | ||
271 | goto _continue_9 | ||
272 | end | ||
273 | break | ||
274 | ::_continue_9:: | ||
275 | end | ||
276 | while true do | ||
277 | if false then | ||
278 | goto _continue_10 | ||
279 | end | ||
280 | do | ||
281 | return 22 | ||
282 | end | ||
283 | ::_continue_10:: | ||
284 | end | ||
285 | do | ||
286 | local _u4e09_u91cdx = { | ||
287 | 1, | ||
288 | 2, | ||
289 | 3, | ||
290 | 4 | ||
291 | } | ||
292 | for _index_0 = 1, #_u4e09_u91cdx do | ||
293 | local _u4e1c_u897f = _u4e09_u91cdx[_index_0] | ||
294 | _u6253_u5370(_u4e1c_u897f) | ||
295 | end | ||
296 | end | ||
297 | do | ||
298 | for _u53d8_u91cfi = 1, 10 do | ||
299 | repeat | ||
300 | do | ||
301 | local _with_0 = _u5bf9_u8c61tb | ||
302 | if _with_0 ~= nil then | ||
303 | _with_0["字段a"] = 1 | ||
304 | if _with_0["字段b"] then | ||
305 | goto _continue_12 | ||
306 | end | ||
307 | do | ||
308 | if _with_0["字段c"] then | ||
309 | break | ||
310 | end | ||
311 | end | ||
312 | end | ||
313 | end | ||
314 | ::_continue_12:: | ||
315 | until true | ||
316 | if 123 == _u53d8_u91cfx then | ||
317 | break | ||
318 | else | ||
319 | goto _continue_11 | ||
320 | end | ||
321 | if _u53d8_u91cfy then | ||
322 | goto _continue_11 | ||
323 | else | ||
324 | break | ||
325 | end | ||
326 | do | ||
327 | do | ||
328 | do | ||
329 | _u6253_u5370(_u53d8_u91cfi) | ||
330 | goto _continue_11 | ||
331 | end | ||
332 | end | ||
333 | end | ||
334 | _u6253_u5370("abc") | ||
335 | ::_continue_11:: | ||
336 | end | ||
337 | end | ||
diff --git a/spec/outputs/unicode/macro.lua b/spec/outputs/unicode/macro.lua new file mode 100644 index 0000000..2ae5dce --- /dev/null +++ b/spec/outputs/unicode/macro.lua | |||
@@ -0,0 +1,321 @@ | |||
1 | assert(_u5bf9_u8c61 == nil) | ||
2 | local _u7ed3_u679c = (_u5bf9_u8c61 == nil) | ||
3 | if _u51fd_u65701() then | ||
4 | _u6253_u5370("没问题") | ||
5 | end | ||
6 | if (_u51fd_u65701() and _u51fd_u65702() and _u51fd_u65703()) then | ||
7 | _u6253_u5370("没问题") | ||
8 | end | ||
9 | local _u5bf9_u8c61 | ||
10 | do | ||
11 | local __u6e90_, __u76ee_u6807_ | ||
12 | do | ||
13 | __u76ee_u6807_ = { | ||
14 | ["位置"] = { }, | ||
15 | ["标签"] = (function() | ||
16 | local _call_0 = _u6807_u7b7e | ||
17 | return _call_0["转数字"](_call_0) | ||
18 | end)() | ||
19 | } | ||
20 | do | ||
21 | __u6e90_ = self | ||
22 | __u76ee_u6807_["标识"] = __u6e90_["标识"] | ||
23 | __u76ee_u6807_["连接们"] = __u6e90_["连接们"] | ||
24 | __u76ee_u6807_["位置"]["x坐标"] = __u6e90_["位置"]["x坐标"] | ||
25 | __u76ee_u6807_["位置"]["y坐标"] = __u6e90_["位置"]["y坐标"] | ||
26 | __u76ee_u6807_["位置"]["z坐标"] = __u6e90_["位置"]["z坐标"] | ||
27 | end | ||
28 | _u5bf9_u8c61 = __u76ee_u6807_ | ||
29 | end | ||
30 | end | ||
31 | if (_u53d8_u91cfx == "🍎" or _u53d8_u91cfx == "🐷" or _u53d8_u91cfx == "🐶") then | ||
32 | _u6253_u5370("存在") | ||
33 | end | ||
34 | local _list_0 = (function() | ||
35 | local _accum_0 = { } | ||
36 | local _len_0 = 1 | ||
37 | local _list_0 = (function() | ||
38 | local _accum_1 = { } | ||
39 | local _len_1 = 1 | ||
40 | local _list_0 = { | ||
41 | 1, | ||
42 | 2, | ||
43 | 3 | ||
44 | } | ||
45 | for _index_0 = 1, #_list_0 do | ||
46 | local _ = _list_0[_index_0] | ||
47 | _accum_1[_len_1] = _ * 2 | ||
48 | _len_1 = _len_1 + 1 | ||
49 | end | ||
50 | return _accum_1 | ||
51 | end)() | ||
52 | for _index_0 = 1, #_list_0 do | ||
53 | local _ = _list_0[_index_0] | ||
54 | if _ > 4 then | ||
55 | _accum_0[_len_0] = _ | ||
56 | _len_0 = _len_0 + 1 | ||
57 | end | ||
58 | end | ||
59 | return _accum_0 | ||
60 | end)() | ||
61 | for _index_0 = 1, #_list_0 do | ||
62 | local _ = _list_0[_index_0] | ||
63 | _u6253_u5370(_) | ||
64 | end | ||
65 | local _list_1 = (function() | ||
66 | local _accum_0 = { } | ||
67 | local _len_0 = 1 | ||
68 | local _list_1 = (function() | ||
69 | local _accum_1 = { } | ||
70 | local _len_1 = 1 | ||
71 | local _list_1 = { | ||
72 | 1, | ||
73 | 2, | ||
74 | 3 | ||
75 | } | ||
76 | for _index_0 = 1, #_list_1 do | ||
77 | local _ = _list_1[_index_0] | ||
78 | _accum_1[_len_1] = _ * 2 | ||
79 | _len_1 = _len_1 + 1 | ||
80 | end | ||
81 | return _accum_1 | ||
82 | end)() | ||
83 | for _index_0 = 1, #_list_1 do | ||
84 | local _ = _list_1[_index_0] | ||
85 | if _ > 4 then | ||
86 | _accum_0[_len_0] = _ | ||
87 | _len_0 = _len_0 + 1 | ||
88 | end | ||
89 | end | ||
90 | return _accum_0 | ||
91 | end)() | ||
92 | for _index_0 = 1, #_list_1 do | ||
93 | local _ = _list_1[_index_0] | ||
94 | _u6253_u5370(_) | ||
95 | end | ||
96 | local _u503c | ||
97 | do | ||
98 | local _2 | ||
99 | do | ||
100 | local _accum_0 = { } | ||
101 | local _len_0 = 1 | ||
102 | local _list_2 = { | ||
103 | 1, | ||
104 | 2, | ||
105 | 3 | ||
106 | } | ||
107 | for _index_0 = 1, #_list_2 do | ||
108 | local _ = _list_2[_index_0] | ||
109 | _accum_0[_len_0] = _ * 2 | ||
110 | _len_0 = _len_0 + 1 | ||
111 | end | ||
112 | _2 = _accum_0 | ||
113 | end | ||
114 | local _3 | ||
115 | do | ||
116 | local _accum_0 = { } | ||
117 | local _len_0 = 1 | ||
118 | for _index_0 = 1, #_2 do | ||
119 | local _ = _2[_index_0] | ||
120 | if _ > 4 then | ||
121 | _accum_0[_len_0] = _ | ||
122 | _len_0 = _len_0 + 1 | ||
123 | end | ||
124 | end | ||
125 | _3 = _accum_0 | ||
126 | end | ||
127 | local _4 | ||
128 | if #_3 == 0 then | ||
129 | _4 = 0 | ||
130 | else | ||
131 | local _1 = 0 | ||
132 | for _index_0 = 1, #_3 do | ||
133 | local _2 = _3[_index_0] | ||
134 | _1 = _1 + _2 | ||
135 | end | ||
136 | _4 = _1 | ||
137 | end | ||
138 | _u503c = _4 | ||
139 | end | ||
140 | local _call_0 = (1 + 2) | ||
141 | _call_0["调用"](_call_0, 123) | ||
142 | _u7ed3_u679c = (1 + 2) | ||
143 | local f | ||
144 | f = function(_u53c2_u6570x) | ||
145 | return function(_u53c2_u6570y) | ||
146 | return function(_u53c2_u6570z) | ||
147 | return _u6253_u5370(_u53c2_u6570x, _u53c2_u6570y, _u53c2_u6570z) | ||
148 | end | ||
149 | end | ||
150 | end | ||
151 | do | ||
152 | local _u53d8_u91cfa = 8 | ||
153 | do | ||
154 | _u53d8_u91cfa = 1 | ||
155 | _u53d8_u91cfa = _u53d8_u91cfa + 1 | ||
156 | end | ||
157 | _u53d8_u91cfa = _u53d8_u91cfa + (function() | ||
158 | _u53d8_u91cfa = 1 | ||
159 | return _u53d8_u91cfa + 1 | ||
160 | end)() | ||
161 | _u6253_u5370(_u53d8_u91cfa) | ||
162 | end | ||
163 | do | ||
164 | local _u53d8_u91cfa = 8 | ||
165 | _u53d8_u91cfa = (function() | ||
166 | local _u53d8_u91cfa | ||
167 | _u53d8_u91cfa = 1 | ||
168 | return _u53d8_u91cfa + 1 | ||
169 | end)() | ||
170 | _u53d8_u91cfa = _u53d8_u91cfa + (function() | ||
171 | local _u53d8_u91cfa | ||
172 | _u53d8_u91cfa = 1 | ||
173 | return _u53d8_u91cfa + 1 | ||
174 | end)() | ||
175 | _u6253_u5370(_u53d8_u91cfa) | ||
176 | end | ||
177 | local _u53d8_u91cfx = 0 | ||
178 | local function f(a) | ||
179 | return a + 1 | ||
180 | end | ||
181 | x = x + f(3) | ||
182 | function tb:func() | ||
183 | print(123) | ||
184 | end | ||
185 | _u6253_u5370(_u53d8_u91cfx) | ||
186 | local sel | ||
187 | sel = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c) | ||
188 | if _u53c2_u6570a then | ||
189 | return _u53c2_u6570b | ||
190 | else | ||
191 | return _u53c2_u6570c | ||
192 | end | ||
193 | end | ||
194 | local function sel(a, b, c) | ||
195 | if a then | ||
196 | return b | ||
197 | else | ||
198 | return c | ||
199 | end | ||
200 | end | ||
201 | local function dummy() | ||
202 | |||
203 | end | ||
204 | -- 这有个注释 | ||
205 | local _ = require('下划线') | ||
206 | local _call_1 = (_({ | ||
207 | 1, | ||
208 | 2, | ||
209 | 3, | ||
210 | 4, | ||
211 | -2, | ||
212 | 3 | ||
213 | })) | ||
214 | _call_1 = _call_1["链"](_call_1, _call_1, _call_1, _call_1, _call_1, _call_1, _call_1, _call_1) | ||
215 | _call_1 = _call_1["映射"](_call_1, _call_1, _call_1, _call_1, function(self) | ||
216 | return self * 2 | ||
217 | end) | ||
218 | _call_1 = _call_1["过滤"](_call_1, _call_1, function(self) | ||
219 | return self > 3 | ||
220 | end) | ||
221 | local _u7ed3_u679ca = _call_1["取值"](_call_1) | ||
222 | local _call_2 = (_({ | ||
223 | 1, | ||
224 | 2, | ||
225 | 3, | ||
226 | 4, | ||
227 | -2, | ||
228 | 3 | ||
229 | })) | ||
230 | _call_2 = _call_2["链"](_call_2, _call_2, _call_2, _call_2, _call_2, _call_2, _call_2, _call_2) | ||
231 | _call_2 = _call_2["映射"](_call_2, _call_2, _call_2, _call_2, function(self) | ||
232 | return self * 2 | ||
233 | end) | ||
234 | _call_2 = _call_2["过滤"](_call_2, _call_2, function(self) | ||
235 | return self > 3 | ||
236 | end) | ||
237 | _call_2["每一个"](_call_2, function(self) | ||
238 | return _u6253_u5370(self) | ||
239 | end) | ||
240 | local _call_3 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] | ||
241 | _call_3 = _call_3["父节点"](_call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3) | ||
242 | _call_3 = _call_3["后代"](_call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3) | ||
243 | _call_3 = _call_3["选择启用"](_call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3) | ||
244 | _call_3 = _call_3["选择可见"](_call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3, _call_3) | ||
245 | _call_3 = _call_3["标签等于"](_call_3, _call_3, _call_3, _call_3, "fx") | ||
246 | _call_3 = _call_3["其中"](_call_3, _call_3, function(x) | ||
247 | local _call_4 = x["名称"] | ||
248 | return _call_4["结尾为"](_call_4, _call_4, "(克隆)") | ||
249 | end) | ||
250 | _u7ed3_u679c = _call_3["摧毁"](_call_3) | ||
251 | do | ||
252 | local _1 | ||
253 | local _call_4 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] | ||
254 | _1 = _call_4["父节点"](_call_4) | ||
255 | local _2 | ||
256 | _2 = _1["后代"](_1) | ||
257 | local _3 | ||
258 | _3 = _2["选择启用"](_2) | ||
259 | local _4 | ||
260 | _4 = _3["选择可见"](_3) | ||
261 | local _5 | ||
262 | _5 = _4["标签等于"](_4, "fx") | ||
263 | local _6 | ||
264 | _6 = _5["其中"](_5, function(x) | ||
265 | local _call_5 = x["名称"] | ||
266 | return _call_5["结尾为"](_call_5, "(克隆)") | ||
267 | end) | ||
268 | _6["摧毁"](_6) | ||
269 | end | ||
270 | local _call_0 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] | ||
271 | _call_0["父节点"](_call_0):_u540e_u4ee3():_u9009_u62e9_u542f_u7528():_u9009_u62e9_u53ef_u89c1():_u6807_u7b7e_u7b49_u4e8e("fx"):_u5176_u4e2d(function(x) | ||
272 | local _call_0 = x["名称"] | ||
273 | return _call_0["结尾为"](_call_0, "(克隆)") | ||
274 | end):_u6467_u6bc1() | ||
275 | _u6253_u5370((setmetatable({ | ||
276 | 'abc', | ||
277 | ["字段a"] = 123, | ||
278 | }, { | ||
279 | __call = function(self) | ||
280 | return 998 | ||
281 | end | ||
282 | }))[1], (setmetatable({ | ||
283 | 'abc', | ||
284 | ["字段a"] = 123, | ||
285 | }, { | ||
286 | __call = function(self) | ||
287 | return 998 | ||
288 | end | ||
289 | }))["字段a"], (setmetatable({ | ||
290 | 'abc', | ||
291 | ["字段a"] = 123, | ||
292 | }, { | ||
293 | __call = function(self) | ||
294 | return 998 | ||
295 | end | ||
296 | }))(), setmetatable({ | ||
297 | 'abc', | ||
298 | ["字段a"] = 123, | ||
299 | }, { | ||
300 | __call = function(self) | ||
301 | return 998 | ||
302 | end | ||
303 | })) | ||
304 | _u6253_u5370("当前代码行数: " .. tostring(268)) | ||
305 | -- 待实现 | ||
306 | do | ||
307 | _u6253_u5370(1) | ||
308 | end | ||
309 | local _1 | ||
310 | _1 = function() | ||
311 | _u6253_u5370(1) | ||
312 | local _accum_0 = { } | ||
313 | local _len_0 = 1 | ||
314 | while false do | ||
315 | break | ||
316 | _len_0 = _len_0 + 1 | ||
317 | end | ||
318 | return _accum_0 | ||
319 | end | ||
320 | _u6253_u5370('abc') | ||
321 | return 123 | ||
diff --git a/spec/outputs/unicode/metatable.lua b/spec/outputs/unicode/metatable.lua new file mode 100644 index 0000000..b6ee48a --- /dev/null +++ b/spec/outputs/unicode/metatable.lua | |||
@@ -0,0 +1,168 @@ | |||
1 | local _u53d8_u91cfa = setmetatable({ | ||
2 | ["关闭"] = true, | ||
3 | }, { | ||
4 | __close = function(self) | ||
5 | return _u6253_u5370("离开作用域") | ||
6 | end | ||
7 | }) | ||
8 | local _u53d8_u91cfb = setmetatable({ }, { | ||
9 | __add = function(_u5de6, _u53f3) | ||
10 | return _u53f3 - _u5de6 | ||
11 | end | ||
12 | }) | ||
13 | local _u53d8_u91cfc = setmetatable({ | ||
14 | ["键1"] = true, | ||
15 | ["键2"] = true | ||
16 | }, { | ||
17 | __add = add | ||
18 | }) | ||
19 | local _u53d8_u91cfw = setmetatable({ }, { | ||
20 | [_u540d_u79f0] = 123, | ||
21 | ["新建"] = function(self, _u503c) | ||
22 | return { | ||
23 | _u503c | ||
24 | } | ||
25 | end | ||
26 | }) | ||
27 | getmetatable(_u53d8_u91cfw)["新建"](getmetatable(_u53d8_u91cfw)[_u540d_u79f0]) | ||
28 | do | ||
29 | local _ <close> = setmetatable({ }, { | ||
30 | __close = function() | ||
31 | return _u6253_u5370("离开作用域") | ||
32 | end | ||
33 | }) | ||
34 | end | ||
35 | local _u53d8_u91cfd, _u53d8_u91cfe = _u53d8_u91cfa["关闭"], getmetatable(_u53d8_u91cfa).__close | ||
36 | local _u53d8_u91cff = getmetatable(_u53d8_u91cfa):__close(1) | ||
37 | getmetatable(_u53d8_u91cfa).__add = function(x, y) | ||
38 | return x + y | ||
39 | end | ||
40 | do | ||
41 | local _u65b0 = _u53d8_u91cfa["新"] | ||
42 | local close, _u5173_u95edA | ||
43 | do | ||
44 | local _obj_0 = getmetatable(_u53d8_u91cfa) | ||
45 | close, _u5173_u95edA = _obj_0.__close, _obj_0.__close | ||
46 | end | ||
47 | _u6253_u5370(_u65b0, close, _u5173_u95edA) | ||
48 | end | ||
49 | do | ||
50 | local _u53d8_u91cfx, _u65b0, _u53d8_u91cf, close, _u5173_u95edA, num, add, sub | ||
51 | do | ||
52 | local _obj_0, _obj_1 | ||
53 | _u53d8_u91cfx, _obj_0, _obj_1 = 123, _u53d8_u91cfa["变量b"]["变量c"], _u51fd_u6570() | ||
54 | _u65b0, _u53d8_u91cf = _obj_0["新"], _obj_0["变量"] | ||
55 | do | ||
56 | local _obj_2 = getmetatable(_obj_0) | ||
57 | close, _u5173_u95edA = _obj_2.__close, _obj_2.__close | ||
58 | end | ||
59 | num = _obj_1.num | ||
60 | do | ||
61 | local _obj_2 = getmetatable(_obj_1) | ||
62 | add, sub = _obj_2.__add, _obj_2.__sub | ||
63 | end | ||
64 | end | ||
65 | end | ||
66 | setmetatable(_u53d8_u91cfa["变量b"], { }) | ||
67 | _u53d8_u91cfx.abc = 123 | ||
68 | setmetatable(_u51fd_u6570(), mt) | ||
69 | setmetatable(_u53d8_u91cfb["变量c"], mt) | ||
70 | _u53d8_u91cfa, _u53d8_u91cfd, _u53d8_u91cfe = 1, "abc", nil | ||
71 | local _u76f8_u540c = getmetatable(_u53d8_u91cfa).__index == getmetatable(_u53d8_u91cfa).__index | ||
72 | setmetatable(_u53d8_u91cfa, { | ||
73 | __index = _u8868 | ||
74 | }) | ||
75 | getmetatable(_u53d8_u91cfa).__index = _u8868 | ||
76 | getmetatable(_u53d8_u91cfa).__index = _u8868 | ||
77 | local mt = getmetatable(_u53d8_u91cfa) | ||
78 | local _call_0 = _u8868 | ||
79 | _call_0["函数"](_call_0, #_u5217_u8868) | ||
80 | do | ||
81 | local _obj_0 = getmetatable(_u8868) | ||
82 | _obj_0["函数"](_obj_0, _u5217_u8868) | ||
83 | end | ||
84 | do | ||
85 | local _obj_0 = getmetatable(_u8868) | ||
86 | _obj_0["函数"](_obj_0, _u5217_u8868) | ||
87 | end | ||
88 | local index, _u8bbe_u7f6e_u51fd_u6570 | ||
89 | do | ||
90 | local _obj_0 = getmetatable(require("模块")) | ||
91 | index, _u8bbe_u7f6e_u51fd_u6570 = _obj_0.__index, _obj_0.__newindex | ||
92 | end | ||
93 | do | ||
94 | local _with_0 = _u8868 | ||
95 | _u6253_u5370(getmetatable(_with_0).__add, getmetatable(_with_0.x):__index("key")) | ||
96 | do | ||
97 | local _obj_0 = getmetatable(getmetatable(getmetatable(_with_0).__index).__add) | ||
98 | _u53d8_u91cfa = _obj_0["新建"](_obj_0, 123) | ||
99 | end | ||
100 | _u53d8_u91cfb = t(#getmetatable(_with_0).__close["测试"]) | ||
101 | _u53d8_u91cfc = t(#getmetatable(_with_0).__close(_with_0["测试"])) | ||
102 | end | ||
103 | mt = getmetatable(_u53d8_u91cfa) | ||
104 | _u53d8_u91cfa = setmetatable({ }, mt) | ||
105 | _u53d8_u91cfa = setmetatable({ }, { | ||
106 | __index = mt | ||
107 | }) | ||
108 | local index | ||
109 | local _u7d22_u5f15 = getmetatable(_u53d8_u91cfa).__index | ||
110 | index = getmetatable(_u53d8_u91cfa).__index | ||
111 | do | ||
112 | local _u6784_u9020, _u66f4_u65b0 | ||
113 | do | ||
114 | local _obj_0 = getmetatable(_u53d8_u91cfa) | ||
115 | _u6784_u9020, _u66f4_u65b0 = _obj_0["新"], _obj_0["更新"] | ||
116 | end | ||
117 | end | ||
118 | do | ||
119 | local _u6784_u9020, _u66f4_u65b0 | ||
120 | do | ||
121 | local _obj_0 = getmetatable(_u53d8_u91cfa) | ||
122 | _u6784_u9020, _u66f4_u65b0 = _obj_0["新"], _obj_0["更新"] | ||
123 | end | ||
124 | end | ||
125 | local _u8868 = { } | ||
126 | do | ||
127 | do | ||
128 | local _obj_0 = getmetatable(_u8868) | ||
129 | _u53d8_u91cff = _obj_0["值" .. tostring(x < y)](_obj_0, 123, ...) | ||
130 | end | ||
131 | _u53d8_u91cff((function(...) | ||
132 | local _obj_0 = getmetatable(_u8868) | ||
133 | return _obj_0['值'](_obj_0, 123, ...) | ||
134 | end)(...)) | ||
135 | do | ||
136 | local _obj_0 = getmetatable(_u8868) | ||
137 | _obj_0[ [[ 值 | ||
138 | 1 | ||
139 | ]]](_obj_0, 123, ...) | ||
140 | end | ||
141 | local _obj_0 = getmetatable(_u8868) | ||
142 | return _obj_0["值" .. tostring(x > y)](_obj_0, 123, ...) | ||
143 | end | ||
144 | do | ||
145 | do | ||
146 | local _obj_0 = getmetatable(_u8868) | ||
147 | _u53d8_u91cff = _obj_0['值'](_obj_0, 123, ...) | ||
148 | end | ||
149 | _u53d8_u91cff((function(...) | ||
150 | local _obj_0 = getmetatable(_u8868) | ||
151 | return _obj_0['值'](_obj_0, 123, ...) | ||
152 | end)(...)) | ||
153 | do | ||
154 | local _obj_0 = getmetatable(_u8868) | ||
155 | _obj_0['值'](_obj_0, 123, ...) | ||
156 | end | ||
157 | local _obj_0 = getmetatable(_u8868) | ||
158 | return _obj_0['值'](_obj_0, 123, ...) | ||
159 | end | ||
160 | do | ||
161 | _u53d8_u91cff = getmetatable(_u8868)["值"](123, ...) | ||
162 | _u53d8_u91cff = getmetatable(_u8868)["值" .. tostring(x < y)](123, ...) | ||
163 | _u53d8_u91cff(getmetatable(_u8868)['值'](123, ...)) | ||
164 | getmetatable(_u8868)[ [[ 值 | ||
165 | 1]]](123, ...) | ||
166 | return getmetatable(_u8868)["值" .. tostring(x > y)](123, ...) | ||
167 | end | ||
168 | return nil | ||
diff --git a/spec/outputs/unicode/multiline_chain.lua b/spec/outputs/unicode/multiline_chain.lua new file mode 100644 index 0000000..90fdf0b --- /dev/null +++ b/spec/outputs/unicode/multiline_chain.lua | |||
@@ -0,0 +1,135 @@ | |||
1 | local _u53d8_u91cfx = _u53d8_u91cfa["变量b"]["变量c"]["变量d"] | ||
2 | local _call_0 = _u53d8_u91cfa["变量b"] | ||
3 | _u53d8_u91cfx["变量y"] = _call_0["变量c"](_call_0) | ||
4 | _u51fd_u6570(1, (function() | ||
5 | local _call_1 = _u53c2_u65702["值"] | ||
6 | return _call_1["获取"](_call_1) | ||
7 | end)(), (function() | ||
8 | local _call_1 = _u53c2_u65703["值"] | ||
9 | return _call_1["获取"](_call_1) | ||
10 | end)(), { | ||
11 | 1, | ||
12 | ((function() | ||
13 | if _u53d8_u91cfx ~= nil then | ||
14 | local _obj_0 = _u53d8_u91cfx["变量y"] | ||
15 | if _obj_0 ~= nil then | ||
16 | return _obj_0["变量z"] | ||
17 | end | ||
18 | return nil | ||
19 | end | ||
20 | return nil | ||
21 | end)() ~= nil), | ||
22 | 3 | ||
23 | }) | ||
24 | local _u8868bb = { | ||
25 | ["键1"] = (function() | ||
26 | local _call_1 = _u53d8_u91cfa | ||
27 | return _call_1["变量b"](_call_1, 123)["变量c"]() | ||
28 | end)(), | ||
29 | ["键2"] = { | ||
30 | ["键w1"] = (function() | ||
31 | local _call_1 = _u53d8_u91cfa()["变量b"] | ||
32 | return _call_1["变量c"](_call_1) | ||
33 | end)() | ||
34 | } | ||
35 | } | ||
36 | local _u8868b | ||
37 | do | ||
38 | local _obj_0 = _u51fd_u65702 | ||
39 | if _obj_0 ~= nil then | ||
40 | _u8868b = _obj_0("abc", _u51fd_u65701({ })["变量a"]) | ||
41 | end | ||
42 | end | ||
43 | local _u51fd_u6570 | ||
44 | _u51fd_u6570 = function() | ||
45 | local _accum_0 = { } | ||
46 | local _len_0 = 1 | ||
47 | local _list_0 = _u503c_u96c6_u5408 | ||
48 | for _index_0 = 1, #_list_0 do | ||
49 | local _des_0 = _list_0[_index_0] | ||
50 | local _u53d8_u91cfa = _des_0[1] | ||
51 | local _call_1 = _u53d8_u91cfa["变量b"] | ||
52 | _accum_0[_len_0] = _call_1["变量c"](_call_1, 123) | ||
53 | _len_0 = _len_0 + 1 | ||
54 | end | ||
55 | return _accum_0 | ||
56 | end | ||
57 | local _u51fd_u65701 | ||
58 | _u51fd_u65701 = function() | ||
59 | return _u53d8_u91cfx, (function() | ||
60 | local _call_1 = _u53d8_u91cfa | ||
61 | return _call_1["变量b"](_call_1, 123)["变量c"]("abc") | ||
62 | end)() | ||
63 | end | ||
64 | local _call_1 = _u539f_u59cb["转换"].root.gameObject | ||
65 | local _call_2 = _call_1["父节点"](_call_1) | ||
66 | local _call_3 = _call_2["后代节点"](_call_2) | ||
67 | local _call_4 = _call_3["选择启用"](_call_3) | ||
68 | local _call_5 = _call_4["选择可见"](_call_4) | ||
69 | local _call_6 = _call_5["标签相等"](_call_5, "fx") | ||
70 | local _call_7 = _call_6["筛选"](_call_6, function(_u5143_u7d20) | ||
71 | if _u5143_u7d20["是否目标"](_u5143_u7d20, _u5143_u7d20) then | ||
72 | return false | ||
73 | end | ||
74 | local _call_7 = _u5143_u7d20["名称"] | ||
75 | return _call_7["结束于"](_call_7, _call_7, "(Clone)") | ||
76 | end) | ||
77 | local _u7ed3_u679c = _call_7["销毁"](_call_7) | ||
78 | local _call_8 = _u539f_u70b9["变换"]["根节点"]["游戏对象"] | ||
79 | local _call_9 = _call_8["父节点"](_call_8) | ||
80 | local _call_10 = _call_9["后代节点"](_call_9) | ||
81 | local _call_11 = _call_10["选择启用"](_call_10) | ||
82 | local _call_12 = _call_11["选择可见"](_call_11) | ||
83 | local _call_13 = _call_12["标签相等"](_call_12, "fx") | ||
84 | local _call_14 = _call_13["筛选"](_call_13, function(_u5143_u7d20) | ||
85 | local _call_14 = _u5143_u7d20["名称"] | ||
86 | return _call_14["结束于"](_call_14, _call_14, "(Clone)") | ||
87 | end) | ||
88 | _call_14["销毁"](_call_14) | ||
89 | do | ||
90 | local _with_0 = _u9879_u76ee | ||
91 | _with_0["项目字段A"] = 123 | ||
92 | local _call_15 = _with_0["调用方法"](_with_0) | ||
93 | _call_15["连续调用"](_call_15) | ||
94 | local _call_16 = _with_0["调用方法"](_with_0) | ||
95 | _call_16["连续调用"](_call_16) | ||
96 | _with_0["连续调用"](_with_0) | ||
97 | do | ||
98 | local _call_17 = _with_0["项目字段B"] | ||
99 | local _exp_0 = _call_17["取值"](_call_17) | ||
100 | if "Valid" == _exp_0 or _with_0["获取项目状态"](_with_0) == _exp_0 then | ||
101 | local _call_18 = _with_0["项目方法A"](_with_0) | ||
102 | _call_18["取值"](_call_18) | ||
103 | else | ||
104 | local _call_18 = _with_0["项目方法B"](_with_0) | ||
105 | _call_18["取值"](_call_18) | ||
106 | end | ||
107 | end | ||
108 | local _u53d8_u91cfa | ||
109 | if _with_0["项目字段C"] then | ||
110 | _u53d8_u91cfa = _with_0["项目字段D"] | ||
111 | else | ||
112 | _u53d8_u91cfa = _with_0["项目字段E"] | ||
113 | end | ||
114 | local _list_0 = _u503c_u96c6_u5408 | ||
115 | for _index_0 = 1, #_list_0 do | ||
116 | local _u53d8_u91cfv = _list_0[_index_0] | ||
117 | _with_0["项目方法C"](_with_0, _u53d8_u91cfv) | ||
118 | end | ||
119 | for _u53d8_u91cfi = 1, _u8ba1_u6570_u5668 do | ||
120 | _with_0["项目方法C"](_with_0, _u53d8_u91cfi) | ||
121 | end | ||
122 | if not _with_0["变量b"] then | ||
123 | do | ||
124 | local _accum_0 = { } | ||
125 | local _len_0 = 1 | ||
126 | while _with_0["项目字段D"] do | ||
127 | local _call_17 = _with_0["下一个项目"](_with_0) | ||
128 | _accum_0[_len_0] = _call_17["取得"](_call_17) | ||
129 | _len_0 = _len_0 + 1 | ||
130 | end | ||
131 | _with_0["变量c"] = _accum_0 | ||
132 | end | ||
133 | end | ||
134 | end | ||
135 | return nil | ||
diff --git a/spec/outputs/unicode/nil_coalescing.lua b/spec/outputs/unicode/nil_coalescing.lua new file mode 100644 index 0000000..90fd097 --- /dev/null +++ b/spec/outputs/unicode/nil_coalescing.lua | |||
@@ -0,0 +1,182 @@ | |||
1 | do | ||
2 | local _u53d8_u91cfa | ||
3 | do | ||
4 | local _exp_0 = _u53d8_u91cfb | ||
5 | if _exp_0 ~= nil then | ||
6 | _u53d8_u91cfa = _exp_0 | ||
7 | else | ||
8 | _u53d8_u91cfa = _u53d8_u91cfc | ||
9 | end | ||
10 | end | ||
11 | end | ||
12 | do | ||
13 | local _u5b57_u6bb5a | ||
14 | do | ||
15 | local _exp_0 = _u53d8_u91cfb | ||
16 | if _exp_0 ~= nil then | ||
17 | _u5b57_u6bb5a = _exp_0["字段a"] | ||
18 | else | ||
19 | _u5b57_u6bb5a = _u53d8_u91cfc["字段a"] | ||
20 | end | ||
21 | end | ||
22 | end | ||
23 | do | ||
24 | local _u53d8_u91cfa = _u51fd_u6570() | ||
25 | if _u53d8_u91cfa == nil then | ||
26 | _u53d8_u91cfa = false | ||
27 | end | ||
28 | end | ||
29 | do | ||
30 | local _u53d8_u91cfa | ||
31 | if _u53d8_u91cfa == nil then | ||
32 | _u53d8_u91cfa = _u51fd_u6570() | ||
33 | end | ||
34 | end | ||
35 | do | ||
36 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd, _u53d8_u91cfe | ||
37 | if _u53d8_u91cfb ~= nil then | ||
38 | _u53d8_u91cfa = _u53d8_u91cfb | ||
39 | else | ||
40 | if _u53d8_u91cfc ~= nil then | ||
41 | _u53d8_u91cfa = _u53d8_u91cfc | ||
42 | else | ||
43 | if _u53d8_u91cfd ~= nil then | ||
44 | _u53d8_u91cfa = _u53d8_u91cfd | ||
45 | else | ||
46 | _u53d8_u91cfa = _u53d8_u91cfe | ||
47 | end | ||
48 | end | ||
49 | end | ||
50 | end | ||
51 | do | ||
52 | local _u53d8_u91cfa | ||
53 | do | ||
54 | local _exp_0 = _u53d8_u91cfb | ||
55 | if _exp_0 ~= nil then | ||
56 | _u53d8_u91cfa = _exp_0 | ||
57 | else | ||
58 | do | ||
59 | local _exp_1 = _u53d8_u91cfc | ||
60 | if _exp_1 ~= nil then | ||
61 | _u53d8_u91cfa = _exp_1 | ||
62 | else | ||
63 | do | ||
64 | local _exp_2 = _u53d8_u91cfd | ||
65 | if _exp_2 ~= nil then | ||
66 | _u53d8_u91cfa = _exp_2 | ||
67 | else | ||
68 | _u53d8_u91cfa = _u53d8_u91cfe | ||
69 | end | ||
70 | end | ||
71 | end | ||
72 | end | ||
73 | end | ||
74 | end | ||
75 | end | ||
76 | do | ||
77 | _u51fd_u6570((function() | ||
78 | local _exp_0 = _u53d8_u91cfx | ||
79 | if _exp_0 ~= nil then | ||
80 | return _exp_0 | ||
81 | else | ||
82 | return "你好" | ||
83 | end | ||
84 | end)()) | ||
85 | end | ||
86 | do | ||
87 | do | ||
88 | local _with_0 | ||
89 | do | ||
90 | local _exp_0 = _u51fd_u6570A() | ||
91 | if _exp_0 ~= nil then | ||
92 | _with_0 = _exp_0 | ||
93 | else | ||
94 | _with_0 = _u51fd_u6570B() | ||
95 | end | ||
96 | end | ||
97 | _u6253_u5370(_with_0["字段"]) | ||
98 | end | ||
99 | end | ||
100 | do | ||
101 | local _u53d8_u91cfa = 1 + 2 + (function() | ||
102 | local _exp_0 = _u53d8_u91cfb | ||
103 | if _exp_0 ~= nil then | ||
104 | return _exp_0 | ||
105 | else | ||
106 | return _u53d8_u91cfc + 3 + 4 | ||
107 | end | ||
108 | end)() | ||
109 | end | ||
110 | do | ||
111 | local _u53d8_u91cfa = 1 + 2 + ((function() | ||
112 | local _exp_0 = _u53d8_u91cfb | ||
113 | if _exp_0 ~= nil then | ||
114 | return _exp_0 | ||
115 | else | ||
116 | return _u53d8_u91cfc | ||
117 | end | ||
118 | end)()) + 3 + 4 | ||
119 | end | ||
120 | do | ||
121 | local _u5b57_u6bb5a, _u5b57_u6bb5b | ||
122 | do | ||
123 | local _obj_0 = _u51fd_u6570() | ||
124 | _u5b57_u6bb5a, _u5b57_u6bb5b = _obj_0["字段a"], _obj_0["字段b"] | ||
125 | end | ||
126 | local _u53d8_u91cfa = _u53d8_u91cfa or 1 | ||
127 | local _u53d8_u91cfb | ||
128 | if _u53d8_u91cfb == nil then | ||
129 | do | ||
130 | local _exp_0 = _u53d8_u91cfc | ||
131 | if _exp_0 ~= nil then | ||
132 | _u53d8_u91cfb = _exp_0 | ||
133 | else | ||
134 | _u53d8_u91cfb = 2 | ||
135 | end | ||
136 | end | ||
137 | end | ||
138 | end | ||
139 | do | ||
140 | local _u53d8_u91cfa | ||
141 | do | ||
142 | local _exp_0 = 1 | ||
143 | if _exp_0 ~= nil then | ||
144 | _u53d8_u91cfa = _exp_0 | ||
145 | else | ||
146 | do | ||
147 | local _exp_1 = 2 | ||
148 | if _exp_1 ~= nil then | ||
149 | _u53d8_u91cfa = _exp_1 | ||
150 | else | ||
151 | _u53d8_u91cfa = 3 | ||
152 | end | ||
153 | end | ||
154 | end | ||
155 | end | ||
156 | end | ||
157 | do | ||
158 | local _obj_0 = _u53d8_u91cfa["字段"] | ||
159 | if _obj_0["字段"] == nil then | ||
160 | _obj_0["字段"] = 1 | ||
161 | end | ||
162 | local _u53d8_u91cfa | ||
163 | do | ||
164 | local _exp_0 = _u53d8_u91cfb["字段"] | ||
165 | if _exp_0 ~= nil then | ||
166 | _u53d8_u91cfa = _exp_0 | ||
167 | else | ||
168 | do | ||
169 | local _exp_1 = _u53d8_u91cfc["字段"] | ||
170 | if _exp_1 ~= nil then | ||
171 | _u53d8_u91cfa = _exp_1 | ||
172 | else | ||
173 | _u53d8_u91cfa = _u53d8_u91cfd["字段"] | ||
174 | end | ||
175 | end | ||
176 | end | ||
177 | end | ||
178 | if _u53d8_u91cfa["字段"] == nil then | ||
179 | _u53d8_u91cfa["字段"] = 1 | ||
180 | end | ||
181 | end | ||
182 | return nil | ||
diff --git a/spec/outputs/unicode/operators.lua b/spec/outputs/unicode/operators.lua new file mode 100644 index 0000000..c515dd1 --- /dev/null +++ b/spec/outputs/unicode/operators.lua | |||
@@ -0,0 +1,29 @@ | |||
1 | local _u6570_u5b57x = 1 + 3 | ||
2 | local _u6570_u5b57y = 1 + 3 | ||
3 | local _u6570_u5b57z = 1 + 3 + 4 | ||
4 | local _u6570_u5b57k = _u53d8_u91cfb and _u53d8_u91cfc and _u53d8_u91cfg | ||
5 | local _u53d8_u91cfh = _u4e1c_u897f and function() | ||
6 | return _u6253_u5370("你好 世界") | ||
7 | end | ||
8 | local _u53d8_u91cfi = _u4e1c_u897f or function() | ||
9 | return _u6253_u5370("你好 世界") | ||
10 | end | ||
11 | local _u53d8_u91cfp = _u4e1c_u897f and function() end | ||
12 | _u6253_u5370("你好 世界") | ||
13 | local _u53d8_u91cfs = _u4e1c_u897f or function() end and 234 | ||
14 | local _u53d8_u91cfu = { | ||
15 | ["颜色"] = 1 and 2 and 3, | ||
16 | 4, | ||
17 | 4 | ||
18 | } | ||
19 | local _u53d8_u91cfv = { | ||
20 | ["颜色"] = 1 and function() | ||
21 | return "yeah" | ||
22 | end, | ||
23 | "great", | ||
24 | ["好的"] = 3 ^ 2 | ||
25 | } | ||
26 | local _u53d8_u91cfnno = (_u662f_u7684 + 2) | ||
27 | local _u53d8_u91cfnn = (_u662f_u7684 + 2) | ||
28 | local _u53d8_u91cfn = _u4f60_u597d(_u53d8_u91cfb)(function() end) | ||
29 | return _u4f60_u597d(_u53d8_u91cfa, (_u662f_u7684 + 2) - _u597d_u7684) | ||
diff --git a/spec/outputs/unicode/pipe.lua b/spec/outputs/unicode/pipe.lua new file mode 100644 index 0000000..6e262ae --- /dev/null +++ b/spec/outputs/unicode/pipe.lua | |||
@@ -0,0 +1,135 @@ | |||
1 | _u6bcf_u4e00_u4e2a({ | ||
2 | "abc", | ||
3 | 123, | ||
4 | 998 | ||
5 | }, _u6253_u5370) | ||
6 | _u6253_u5370(_u5408_u5e76(_u8fc7_u6ee4(_u6620_u5c04({ | ||
7 | 1, | ||
8 | 2, | ||
9 | 3 | ||
10 | }, function(_u53d8_u91cfx) | ||
11 | return _u53d8_u91cfx * 2 | ||
12 | end), function(_u53d8_u91cfx) | ||
13 | return _u53d8_u91cfx > 4 | ||
14 | end), 0, function(_u53d8_u91cfa, _u53d8_u91cfb) | ||
15 | return _u53d8_u91cfa + _u53d8_u91cfb | ||
16 | end)) | ||
17 | _u6253_u5370(table.concat((function() | ||
18 | local _accum_0 = { } | ||
19 | local _len_0 = 1 | ||
20 | for i = 0, 10 do | ||
21 | _accum_0[_len_0] = tostring(i) | ||
22 | _len_0 = _len_0 + 1 | ||
23 | end | ||
24 | return _accum_0 | ||
25 | end)(), ",")) | ||
26 | local _u53d8_u91cfb = 1 + 2 + (_u6253_u5370(tostring(4), 1) or 123) | ||
27 | do | ||
28 | local _u53d8_u91cfx = math.max(233, 998) | ||
29 | if _u53d8_u91cfx then | ||
30 | _u6253_u5370(_u53d8_u91cfx) | ||
31 | end | ||
32 | end | ||
33 | do | ||
34 | local _with_0 | ||
35 | do | ||
36 | local _obj_0 = _u521b_u5efa | ||
37 | if _obj_0 ~= nil then | ||
38 | _with_0 = _obj_0(_u53d8_u91cfb, "new") | ||
39 | end | ||
40 | end | ||
41 | _with_0.value = 123 | ||
42 | _u6253_u5370(_with_0["工作"](_with_0)) | ||
43 | end | ||
44 | do | ||
45 | local _obj_0 = _u51fd_u6570f | ||
46 | if _obj_0 ~= nil then | ||
47 | _obj_0(123) | ||
48 | end | ||
49 | end | ||
50 | do | ||
51 | local _obj_0 = _u51fd_u65702 | ||
52 | if _obj_0 ~= nil then | ||
53 | _obj_0((function() | ||
54 | local _obj_1 = _u51fd_u65701 | ||
55 | if _obj_1 ~= nil then | ||
56 | return _obj_1("abc") | ||
57 | end | ||
58 | return nil | ||
59 | end)()) | ||
60 | end | ||
61 | end | ||
62 | local _u53d8_u91cfc | ||
63 | do | ||
64 | local _obj_0 = _u51fd_u65702 | ||
65 | if _obj_0 ~= nil then | ||
66 | _u53d8_u91cfc = _obj_0((function() | ||
67 | local _obj_1 = _u51fd_u65701 | ||
68 | if _obj_1 ~= nil then | ||
69 | return _obj_1("abc") | ||
70 | end | ||
71 | return nil | ||
72 | end)()) | ||
73 | end | ||
74 | end | ||
75 | local _u51fd_u6570f | ||
76 | _u51fd_u6570f = function() | ||
77 | local _obj_0 = x.y | ||
78 | if _obj_0 ~= nil then | ||
79 | return _obj_0["如果"](_obj_0, _u53c2_u6570) | ||
80 | end | ||
81 | return nil | ||
82 | end | ||
83 | _u51fd_u65702(998, "abc", _u51fd_u65701(_u51fd_u65700(233))) | ||
84 | _u51fd_u65702(_u51fd_u65701(_u51fd_u65700(998, "abc", 233))) | ||
85 | _u51fd_u6570f(1, 2, 3, 4, 5) | ||
86 | _u51fd_u6570f(1, _u503c(2), 3, 4, 5) | ||
87 | _u51fd_u6570f(1, 2, _u6570_u7ec4[3], 4, 5) | ||
88 | local _u53d8_u91cfa = _u51fd_u65702(1, _u51fd_u65701(1, 2, 3, tonumber(table.concat({ | ||
89 | "1", | ||
90 | "2", | ||
91 | "3" | ||
92 | }, ""))), 3) | ||
93 | _u6253_u5370(_u6e32_u67d3(_u53d1_u51fa(_u89e3_u6790(_u63d0_u53d6(_u8bfb_u6587_u4ef6("example.txt"), _u8bed_u8a00, { }), _u8bed_u8a00)))) | ||
94 | _u6253_u5370(_u6e32_u67d3(_u53d1_u51fa(_u89e3_u6790(_u63d0_u53d6(_u8bfb_u6587_u4ef6("example.txt"), _u8bed_u8a00, { }), _u8bed_u8a00)))) | ||
95 | _u6253_u5370(_u6e32_u67d3(_u53d1_u51fa(_u89e3_u6790(_u63d0_u53d6(_u8bfb_u6587_u4ef6("example.txt"), _u8bed_u8a00, { }), _u8bed_u8a00)))) | ||
96 | _u51fd_u6570f(not _u51fd_u6570(123)) | ||
97 | do | ||
98 | local _1 = abc(123, -_u51fd_u6570((function() | ||
99 | local _call_0 = _u5217_u8868({ | ||
100 | "abc", | ||
101 | "xyz", | ||
102 | "123" | ||
103 | }) | ||
104 | local _call_1 = _call_0["映射"](_call_0, "#") | ||
105 | return _call_1["值"](_call_1) | ||
106 | end)()), "x") | ||
107 | _2, _3, _4 = 1, 2, _u51fd_u6570f(3) | ||
108 | local _5 | ||
109 | _5 = _u51fd_u65704(_u51fd_u65703(_u51fd_u65702(_u51fd_u65701(_u53d8_u91cfv, 1), 2), 3), 4) | ||
110 | end | ||
111 | local _u53d8_u91cfx = _u51fd_u6570b(_u51fd_u6570a(123)) or _u51fd_u6570d(_u51fd_u6570c(456)) or (function() | ||
112 | local _call_0 = _u51fd_u6570a["if"] | ||
113 | return _call_0["那么"](_call_0, "abc") | ||
114 | end)() or (function() | ||
115 | local _obj_0 = _u51fd_u6570a | ||
116 | if _obj_0 ~= nil then | ||
117 | local _obj_1 = _obj_0["函数b"] | ||
118 | local _obj_2 = _obj_1["函数c"] | ||
119 | if _obj_2 ~= nil then | ||
120 | return _obj_2(_obj_1, 123) | ||
121 | end | ||
122 | return nil | ||
123 | end | ||
124 | return nil | ||
125 | end)() or (function() | ||
126 | local _base_0 = _u53d8_u91cfx | ||
127 | local _fn_0 = _base_0["函数y"] | ||
128 | return _fn_0 and function(...) | ||
129 | return _fn_0(_base_0, ...) | ||
130 | end | ||
131 | end)() | ||
132 | local _u53d8_u91cfx1 = 3 * _u51fd_u6570f(-4) | ||
133 | local _u53d8_u91cfx2 = 3 * _u51fd_u6570f(-2 ^ 2) | ||
134 | local _u53d8_u91cfy = 1 + _u51fd_u6570b(3, (_u51fd_u6570a ^ _u51fd_u6570c)(not #2)) * _u51fd_u65701(_u51fd_u6570f(4 ^ -123)) or 123 | ||
135 | return nil | ||
diff --git a/spec/outputs/unicode/plus.lua b/spec/outputs/unicode/plus.lua new file mode 100644 index 0000000..75e4aac --- /dev/null +++ b/spec/outputs/unicode/plus.lua | |||
@@ -0,0 +1,73 @@ | |||
1 | local _call_0 = _u53d8_u91cfx | ||
2 | _call_0["执行"](_call_0, "工作") | ||
3 | _u65b9_u6cd5((function() | ||
4 | local _call_1 = _u53d8_u91cfa | ||
5 | local _call_2 = _call_1["执行"](_call_1) | ||
6 | local _call_3 = _call_2["结束"](_call_2, "好") | ||
7 | return _call_3["如果"](_call_3, "abc", 123) | ||
8 | end)()) | ||
9 | local _call_1 = _u53d8_u91cfb["函数"] | ||
10 | local _call_2 = _call_1["执行"](_call_1) | ||
11 | local _call_3 = _call_2["当"](_call_2, "好") | ||
12 | local _u7ed3_u679c = _call_3["如果"](_call_3, "def", 998) | ||
13 | local _call_4 = _u53d8_u91cfc["重复"]["如果"] | ||
14 | local _call_5 = _call_4["然后"](_call_4, "xyz") | ||
15 | _call_5["否则"](_call_5, _u7ed3_u679c) | ||
16 | _u6253_u5370(self["循环"], self.__class["函数"](self.__class, 123)) | ||
17 | do | ||
18 | local _call_6 = _u6d88_u606f | ||
19 | local _u989c_u8272 = _call_6["匹配"](_call_6, "<%w*>") | ||
20 | if _u989c_u8272 then | ||
21 | local _call_7 = _u6d88_u606f | ||
22 | local _u6d88_u606f = _call_7["替换"](_call_7, "<%->", _u989c_u8272) | ||
23 | end | ||
24 | end | ||
25 | local _u6d88_u606f | ||
26 | do | ||
27 | local _u989c_u8272 = _u6d88_u606f["匹配"](_u6d88_u606f, "<%w*>") | ||
28 | if _u989c_u8272 then | ||
29 | _u6d88_u606f = _u6d88_u606f["替换"](_u6d88_u606f, "<%->", _u989c_u8272) | ||
30 | end | ||
31 | end | ||
32 | local _u6570_u503cA | ||
33 | do | ||
34 | local _u65b9_u6cd5 = _u83b7_u53d6_u65b9_u6cd5() | ||
35 | if _u65b9_u6cd5 then | ||
36 | _u6570_u503cA = _u65b9_u6cd5() | ||
37 | end | ||
38 | end | ||
39 | local _u6570_u503cA | ||
40 | do | ||
41 | local _u65b9_u6cd5 = _u83b7_u53d6_u65b9_u6cd5() | ||
42 | if _u65b9_u6cd5 then | ||
43 | _u6570_u503cA = _u65b9_u6cd5() | ||
44 | end | ||
45 | end | ||
46 | local _u6570_u503cB | ||
47 | do | ||
48 | local _u65b9_u6cd5 = _u83b7_u53d6_u65b9_u6cd5() | ||
49 | if _u65b9_u6cd5 ~= nil then | ||
50 | _u6570_u503cB = _u65b9_u6cd5() | ||
51 | end | ||
52 | end | ||
53 | _u80cc_u5305 = { | ||
54 | ["东西"] = { | ||
55 | ["好的"] = 200, | ||
56 | ["他们"] = function() | ||
57 | _u6253_u5370("你好") | ||
58 | return _u4f60_u7684_u811a("小") | ||
59 | end, | ||
60 | ["美丽"] = _u5934_u53d1, | ||
61 | ["黄金"] = _u55ef_u54fc | ||
62 | }, | ||
63 | ["为什么"] = 1000, | ||
64 | ["吃"] = _u98df_u7269, | ||
65 | ["好的"] = _u670b_u53cb | ||
66 | } | ||
67 | local _u5f00_u59cb = { | ||
68 | ["东西"] = "冷" | ||
69 | } | ||
70 | local _u6d17_u6fa1 | ||
71 | _u6d17_u6fa1 = { | ||
72 | ["在"] = "火" | ||
73 | } | ||
diff --git a/spec/outputs/unicode/return.lua b/spec/outputs/unicode/return.lua new file mode 100644 index 0000000..250932d --- /dev/null +++ b/spec/outputs/unicode/return.lua | |||
@@ -0,0 +1,126 @@ | |||
1 | local _ | ||
2 | _ = function() | ||
3 | local _list_0 = _u7269_u54c1 | ||
4 | for _index_0 = 1, #_list_0 do | ||
5 | local _u53d8_u91cfx = _list_0[_index_0] | ||
6 | _ = _u53d8_u91cfx | ||
7 | end | ||
8 | end | ||
9 | _ = function() | ||
10 | local _accum_0 = { } | ||
11 | local _len_0 = 1 | ||
12 | local _list_0 = _u7269_u54c1 | ||
13 | for _index_0 = 1, #_list_0 do | ||
14 | local _u53d8_u91cfx = _list_0[_index_0] | ||
15 | _accum_0[_len_0] = _u53d8_u91cfx | ||
16 | _len_0 = _len_0 + 1 | ||
17 | end | ||
18 | return _accum_0 | ||
19 | end | ||
20 | do | ||
21 | local _list_0 = _u7269_u54c1 | ||
22 | for _index_0 = 1, #_list_0 do | ||
23 | local _u53d8_u91cfx = _list_0[_index_0] | ||
24 | return _u53d8_u91cfx | ||
25 | end | ||
26 | end | ||
27 | do | ||
28 | local _accum_0 = { } | ||
29 | local _len_0 = 1 | ||
30 | local _list_0 = _u7269_u54c1 | ||
31 | for _index_0 = 1, #_list_0 do | ||
32 | local _u53d8_u91cfx = _list_0[_index_0] | ||
33 | _accum_0[_len_0] = _u53d8_u91cfx | ||
34 | _len_0 = _len_0 + 1 | ||
35 | end | ||
36 | return _accum_0 | ||
37 | end | ||
38 | do | ||
39 | local _tbl_0 = { } | ||
40 | local _list_0 = _u7269_u54c1 | ||
41 | for _index_0 = 1, #_list_0 do | ||
42 | local _u53d8_u91cfx, _u53d8_u91cfy = _list_0[_index_0] | ||
43 | _tbl_0[_u53d8_u91cfx] = _u53d8_u91cfy | ||
44 | end | ||
45 | return _tbl_0 | ||
46 | end | ||
47 | _ = function() | ||
48 | if _u53d8_u91cfa then | ||
49 | if _u53d8_u91cfa then | ||
50 | return _u53d8_u91cfa | ||
51 | else | ||
52 | return _u53d8_u91cfb | ||
53 | end | ||
54 | elseif _u53d8_u91cfb then | ||
55 | if _u53d8_u91cfa then | ||
56 | return _u53d8_u91cfa | ||
57 | else | ||
58 | return _u53d8_u91cfb | ||
59 | end | ||
60 | else | ||
61 | if _u53d8_u91cfa then | ||
62 | return _u53d8_u91cfa | ||
63 | else | ||
64 | return _u53d8_u91cfb | ||
65 | end | ||
66 | end | ||
67 | end | ||
68 | do | ||
69 | if _u53d8_u91cfa then | ||
70 | if _u53d8_u91cfa then | ||
71 | return _u53d8_u91cfa | ||
72 | else | ||
73 | return _u53d8_u91cfb | ||
74 | end | ||
75 | elseif _u53d8_u91cfb then | ||
76 | if _u53d8_u91cfa then | ||
77 | return _u53d8_u91cfa | ||
78 | else | ||
79 | return _u53d8_u91cfb | ||
80 | end | ||
81 | else | ||
82 | if _u53d8_u91cfa then | ||
83 | return _u53d8_u91cfa | ||
84 | else | ||
85 | return _u53d8_u91cfb | ||
86 | end | ||
87 | end | ||
88 | end | ||
89 | do | ||
90 | return { | ||
91 | ["值"] = _u503c, | ||
92 | ["物品A"] = 123, | ||
93 | ["物品B"] = "abc" | ||
94 | } | ||
95 | end | ||
96 | do | ||
97 | local _tab_0 = { | ||
98 | 1, | ||
99 | 2 | ||
100 | } | ||
101 | local _idx_0 = 1 | ||
102 | for _key_0, _value_0 in pairs(_u4e09) do | ||
103 | if _idx_0 == _key_0 then | ||
104 | _tab_0[#_tab_0 + 1] = _value_0 | ||
105 | _idx_0 = _idx_0 + 1 | ||
106 | else | ||
107 | _tab_0[_key_0] = _value_0 | ||
108 | end | ||
109 | end | ||
110 | _tab_0[#_tab_0 + 1] = 4 | ||
111 | return _tab_0 | ||
112 | end | ||
113 | _ = function() | ||
114 | local _base_0 = _u53d8_u91cfa | ||
115 | local _fn_0 = _base_0["变量b"] | ||
116 | return _fn_0 and function(...) | ||
117 | return _fn_0(_base_0, ...) | ||
118 | end | ||
119 | end | ||
120 | do | ||
121 | local _base_0 = _u53d8_u91cfa | ||
122 | local _fn_0 = _base_0["变量b"] | ||
123 | return _fn_0 and function(...) | ||
124 | return _fn_0(_base_0, ...) | ||
125 | end | ||
126 | end | ||
diff --git a/spec/outputs/unicode/string.lua b/spec/outputs/unicode/string.lua new file mode 100644 index 0000000..6bfb033 --- /dev/null +++ b/spec/outputs/unicode/string.lua | |||
@@ -0,0 +1,53 @@ | |||
1 | local _u4f60_u597d = "你好" | ||
2 | local _u95ee_u5019 = "啥事,好吧" | ||
3 | _u6253_u5370(_u4f60_u597d) | ||
4 | local _u55ef = '嗯' | ||
5 | local _u8fd9_u91cc, _u53e6_u4e00_u4e2a = "好的", '世界' | ||
6 | local _u5440 = "YU'M" | ||
7 | _u4f60('我说:"嗯"') | ||
8 | _u6253_u5370(_u5440, _u4f60) | ||
9 | _u53e6_u4e00_u4e2a = [[ 你好 世界 ]] | ||
10 | local _u4f60_u597d__u90a3_u91cc = [[ 你好呀 | ||
11 | ]] | ||
12 | local _u597d_u5427 = [==[ "helo" ]==] | ||
13 | local _u54c8_u55bd = [===[ eat noots]===] | ||
14 | local _u55ef_u55ef = [[well trhere]] | ||
15 | local _u6587_u5b57 = [[ | ||
16 | nil | ||
17 | Fail to compile | ||
18 | ]] | ||
19 | _u6587_u5b57[ [[abc]]] = [["#{变量i}" for 变量i = 1, 10] for 变量i = 1, 10]] | ||
20 | local _u54e6_u54e6 = "" | ||
21 | local _u53d8_u91cfx = "\\" | ||
22 | _u53d8_u91cfx = "a\\b" | ||
23 | _u53d8_u91cfx = "\\\n" | ||
24 | _u53d8_u91cfx = "\"" | ||
25 | local _u53d8_u91cfa = "你好 " .. tostring(_u95ee_u5019) .. " 你好" | ||
26 | local _u53d8_u91cfb = tostring(_u95ee_u5019) .. " 你好" | ||
27 | local _u53d8_u91cfc = "你好 " .. tostring(5 + 1) | ||
28 | local _u53d8_u91cfd = tostring(_u4f60_u597d(_u4e16_u754c)) | ||
29 | local _u53d8_u91cfe = tostring(1) .. " " .. tostring(2) .. " " .. tostring(3) | ||
30 | local _u53d8_u91cff = [[你好 #{世界} 世界]] | ||
31 | local _u53d8_u91cfg = "#{你好 世界}" | ||
32 | _u53d8_u91cfa = '你好 #{问候} 你好' | ||
33 | _u53d8_u91cfb = '#{问候} 你好' | ||
34 | _u53d8_u91cfc = '你好 #{问候}' | ||
35 | local _u53d8_u91cf_ = "你好" | ||
36 | local _call_0 = ("你好") | ||
37 | _call_0["格式"](_call_0, 1) | ||
38 | local _call_1 = ("你好") | ||
39 | _call_1["格式"](_call_1, 1, 2, 3) | ||
40 | local _call_2 = ("你好") | ||
41 | _call_2["格式"](_call_2, 1, 2, 3)(1, 2, 3) | ||
42 | local _call_3 = ("你好") | ||
43 | _call_3["世界"](_call_3) | ||
44 | local _call_4 = ("你好") | ||
45 | _call_4["格式"](_call_4)["问候"](1, 2, 3) | ||
46 | local _call_5 = ("你好") | ||
47 | _call_5["格式"](_call_5, 1, 2, 3) | ||
48 | local _call_6 = _u67d0_u4e8b("你好") | ||
49 | _call_6["世界"](_call_6) | ||
50 | return _u67d0_u4e8b((function() | ||
51 | local _call_7 = ("你好") | ||
52 | return _call_7["世界"](_call_7) | ||
53 | end)()) | ||
diff --git a/spec/outputs/unicode/stub.lua b/spec/outputs/unicode/stub.lua new file mode 100644 index 0000000..5f183a1 --- /dev/null +++ b/spec/outputs/unicode/stub.lua | |||
@@ -0,0 +1,26 @@ | |||
1 | local _u53d8_u91cfx = { | ||
2 | ["值"] = 100, | ||
3 | ["你好"] = function(self) | ||
4 | return _u6253_u5370(self.val) | ||
5 | end | ||
6 | } | ||
7 | local _u51fd_u6570 | ||
8 | do | ||
9 | local _base_0 = _u53d8_u91cfx | ||
10 | local _fn_0 = _base_0["值"] | ||
11 | _u51fd_u6570 = _fn_0 and function(...) | ||
12 | return _fn_0(_base_0, ...) | ||
13 | end | ||
14 | end | ||
15 | _u6253_u5370(_u51fd_u6570()) | ||
16 | _u6253_u5370(_u53d8_u91cfx["值"](_u53d8_u91cfx)); | ||
17 | (function(...) | ||
18 | do | ||
19 | local _base_0 = _u4f60_u597d(...) | ||
20 | local _fn_0 = _base_0["世界"] | ||
21 | _u53d8_u91cfx = _fn_0 and function(...) | ||
22 | return _fn_0(_base_0, ...) | ||
23 | end | ||
24 | end | ||
25 | end)() | ||
26 | return nil | ||
diff --git a/spec/outputs/unicode/switch.lua b/spec/outputs/unicode/switch.lua new file mode 100644 index 0000000..6b8bbdc --- /dev/null +++ b/spec/outputs/unicode/switch.lua | |||
@@ -0,0 +1,401 @@ | |||
1 | do | ||
2 | local _exp_0 = _u503c | ||
3 | if "酷" == _exp_0 then | ||
4 | _u6253_u5370("你好,世界") | ||
5 | end | ||
6 | end | ||
7 | do | ||
8 | local _exp_0 = _u503c | ||
9 | if "酷" == _exp_0 then | ||
10 | _u6253_u5370("你好,世界") | ||
11 | else | ||
12 | _u6253_u5370("好的,很棒") | ||
13 | end | ||
14 | end | ||
15 | do | ||
16 | local _exp_0 = _u503c | ||
17 | if "酷" == _exp_0 then | ||
18 | _u6253_u5370("你好,世界") | ||
19 | elseif "是的" == _exp_0 then | ||
20 | local _u53d8_u91cf_ = [[FFFF]] + [[MMMM]] | ||
21 | elseif (2323 + 32434) == _exp_0 then | ||
22 | _u6253_u5370("好的") | ||
23 | else | ||
24 | _u6253_u5370("好的,很棒") | ||
25 | end | ||
26 | end | ||
27 | local _u8f93_u51fa | ||
28 | do | ||
29 | local _exp_0 = _u503c | ||
30 | if "酷" == _exp_0 then | ||
31 | _u8f93_u51fa = _u6253_u5370("你好,世界") | ||
32 | else | ||
33 | _u8f93_u51fa = _u6253_u5370("好的,很棒") | ||
34 | end | ||
35 | end | ||
36 | do | ||
37 | local _exp_0 = _u503c | ||
38 | if "酷" == _exp_0 then | ||
39 | _u8f93_u51fa = _u53d8_u91cfx | ||
40 | elseif "哦" == _exp_0 then | ||
41 | _u8f93_u51fa = 34340 | ||
42 | else | ||
43 | _u8f93_u51fa = error("这大大地失败了") | ||
44 | end | ||
45 | end | ||
46 | do | ||
47 | local _with_0 = _u4e1c_u897f | ||
48 | do | ||
49 | local _exp_0 = _with_0["值"](_with_0) | ||
50 | if _with_0["确定"] == _exp_0 then | ||
51 | local _u53d8_u91cf_ = "世界" | ||
52 | else | ||
53 | local _u53d8_u91cf_ = "是的" | ||
54 | end | ||
55 | end | ||
56 | end | ||
57 | _u4fee_u590d(_u8fd9_u4e2a) | ||
58 | call_func((function() | ||
59 | local _exp_0 = _u67d0_u7269 | ||
60 | if 1 == _exp_0 then | ||
61 | return "是" | ||
62 | else | ||
63 | return "否" | ||
64 | end | ||
65 | end)()) | ||
66 | do | ||
67 | local _exp_0 = _u55e8 | ||
68 | if (_u4f60_u597d or _u4e16_u754c) == _exp_0 then | ||
69 | local _u53d8_u91cf_ = _u7eff_u8272 | ||
70 | end | ||
71 | end | ||
72 | do | ||
73 | local _exp_0 = _u55e8 | ||
74 | if "一个" == _exp_0 or "两个" == _exp_0 then | ||
75 | _u6253_u5370("酷") | ||
76 | elseif "爸爸" == _exp_0 then | ||
77 | local _u53d8_u91cf_ = _u5426 | ||
78 | end | ||
79 | end | ||
80 | do | ||
81 | local _exp_0 = _u55e8 | ||
82 | if (3 + 1) == _exp_0 or _u4f60_u597d() == _exp_0 or (function() | ||
83 | return 4 | ||
84 | end)() == _exp_0 then | ||
85 | local _u53d8_u91cf_ = _u9ec4_u8272 | ||
86 | else | ||
87 | _u6253_u5370("酷") | ||
88 | end | ||
89 | end | ||
90 | do | ||
91 | local _u5b57_u5178 = { | ||
92 | { }, | ||
93 | { | ||
94 | 1, | ||
95 | 2, | ||
96 | 3 | ||
97 | }, | ||
98 | ["变量a"] = { | ||
99 | ["变量b"] = { | ||
100 | ["变量c"] = 1 | ||
101 | } | ||
102 | }, | ||
103 | ["变量x"] = { | ||
104 | ["变量y"] = { | ||
105 | ["变量z"] = 1 | ||
106 | } | ||
107 | } | ||
108 | } | ||
109 | do | ||
110 | local _type_0 = type(_u5b57_u5178) | ||
111 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
112 | if _tab_0 then | ||
113 | local _u7b2c_u4e00 = _u5b57_u5178[1] | ||
114 | local _u4e00_u4e2a | ||
115 | do | ||
116 | local _obj_0 = _u5b57_u5178[2] | ||
117 | local _type_1 = type(_obj_0) | ||
118 | if "table" == _type_1 or "userdata" == _type_1 then | ||
119 | _u4e00_u4e2a = _obj_0[1] | ||
120 | end | ||
121 | end | ||
122 | local _u4e24_u4e2a | ||
123 | do | ||
124 | local _obj_0 = _u5b57_u5178[2] | ||
125 | local _type_1 = type(_obj_0) | ||
126 | if "table" == _type_1 or "userdata" == _type_1 then | ||
127 | _u4e24_u4e2a = _obj_0[2] | ||
128 | end | ||
129 | end | ||
130 | local _u4e09_u4e2a | ||
131 | do | ||
132 | local _obj_0 = _u5b57_u5178[2] | ||
133 | local _type_1 = type(_obj_0) | ||
134 | if "table" == _type_1 or "userdata" == _type_1 then | ||
135 | _u4e09_u4e2a = _obj_0[3] | ||
136 | end | ||
137 | end | ||
138 | local _u53d8_u91cfc | ||
139 | do | ||
140 | local _obj_0 = _u5b57_u5178["变量a"] | ||
141 | local _type_1 = type(_obj_0) | ||
142 | if "table" == _type_1 or "userdata" == _type_1 then | ||
143 | do | ||
144 | local _obj_1 = _obj_0["变量b"] | ||
145 | local _type_2 = type(_obj_1) | ||
146 | if "table" == _type_2 or "userdata" == _type_2 then | ||
147 | _u53d8_u91cfc = _obj_1["变量c"] | ||
148 | end | ||
149 | end | ||
150 | end | ||
151 | end | ||
152 | local _u53d8_u91cfz | ||
153 | do | ||
154 | local _obj_0 = _u5b57_u5178["变量x"] | ||
155 | local _type_1 = type(_obj_0) | ||
156 | if "table" == _type_1 or "userdata" == _type_1 then | ||
157 | do | ||
158 | local _obj_1 = _obj_0["变量y"] | ||
159 | local _type_2 = type(_obj_1) | ||
160 | if "table" == _type_2 or "userdata" == _type_2 then | ||
161 | _u53d8_u91cfz = _obj_1["变量z"] | ||
162 | end | ||
163 | end | ||
164 | end | ||
165 | end | ||
166 | if _u7b2c_u4e00 ~= nil and _u4e00_u4e2a ~= nil and _u4e24_u4e2a ~= nil and _u4e09_u4e2a ~= nil and _u53d8_u91cfc ~= nil and _u53d8_u91cfz ~= nil then | ||
167 | _u6253_u5370(_u7b2c_u4e00, _u4e00_u4e2a, _u4e24_u4e2a, _u4e09_u4e2a, _u53d8_u91cfc, _u53d8_u91cfz) | ||
168 | end | ||
169 | end | ||
170 | end | ||
171 | end | ||
172 | do | ||
173 | local _u7269_u54c1 = { | ||
174 | { | ||
175 | ["变量x"] = 100, | ||
176 | ["变量y"] = 200 | ||
177 | }, | ||
178 | { | ||
179 | ["宽度"] = 300, | ||
180 | ["高度"] = 400 | ||
181 | }, | ||
182 | false | ||
183 | } | ||
184 | for _index_0 = 1, #_u7269_u54c1 do | ||
185 | local _u7269 = _u7269_u54c1[_index_0] | ||
186 | do | ||
187 | local _type_0 = type(_u7269) | ||
188 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
189 | local _match_0 = false | ||
190 | if _tab_0 then | ||
191 | local _u53d8_u91cfx = _u7269["变量x"] | ||
192 | local _u53d8_u91cfy = _u7269["变量y"] | ||
193 | if _u53d8_u91cfx ~= nil and _u53d8_u91cfy ~= nil then | ||
194 | _match_0 = true | ||
195 | _u6253_u5370("Vec2 " .. tostring(_u53d8_u91cfx) .. ", " .. tostring(_u53d8_u91cfy)) | ||
196 | end | ||
197 | end | ||
198 | if not _match_0 then | ||
199 | local _match_1 = false | ||
200 | if _tab_0 then | ||
201 | local _u5bbd_u5ea6 = _u7269["宽度"] | ||
202 | local _u9ad8_u5ea6 = _u7269["高度"] | ||
203 | if _u5bbd_u5ea6 ~= nil and _u9ad8_u5ea6 ~= nil then | ||
204 | _match_1 = true | ||
205 | _u6253_u5370("Size " .. tostring(_u5bbd_u5ea6) .. ", " .. tostring(_u9ad8_u5ea6)) | ||
206 | end | ||
207 | end | ||
208 | if not _match_1 then | ||
209 | if false == _u7269 then | ||
210 | _u6253_u5370("没有") | ||
211 | else | ||
212 | local _match_2 = false | ||
213 | if _tab_0 then | ||
214 | local _u7c7b = _u7269["__类"] | ||
215 | if _u7c7b ~= nil then | ||
216 | _match_2 = true | ||
217 | if _u7c7b_u522bA == _u7c7b then | ||
218 | _u6253_u5370("对象 A") | ||
219 | elseif _u7c7b_u522bB == _u7c7b then | ||
220 | _u6253_u5370("对象 B") | ||
221 | end | ||
222 | end | ||
223 | end | ||
224 | if not _match_2 then | ||
225 | local _match_3 = false | ||
226 | if _tab_0 then | ||
227 | local _u8868 = getmetatable(_u7269) | ||
228 | if _u8868 ~= nil then | ||
229 | _match_3 = true | ||
230 | _u6253_u5370("带有元表的表") | ||
231 | end | ||
232 | end | ||
233 | if not _match_3 then | ||
234 | _u6253_u5370("物品不被接受!") | ||
235 | end | ||
236 | end | ||
237 | end | ||
238 | end | ||
239 | end | ||
240 | end | ||
241 | end | ||
242 | end | ||
243 | do | ||
244 | local _u8868_u683c = { } | ||
245 | do | ||
246 | local _type_0 = type(_u8868_u683c) | ||
247 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
248 | if _tab_0 then | ||
249 | local _u53d8_u91cfa = _u8868_u683c["变量a"] | ||
250 | local _u53d8_u91cfb = _u8868_u683c["变量b"] | ||
251 | if _u53d8_u91cfa == nil then | ||
252 | _u53d8_u91cfa = 1 | ||
253 | end | ||
254 | if _u53d8_u91cfb == nil then | ||
255 | _u53d8_u91cfb = 2 | ||
256 | end | ||
257 | _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb) | ||
258 | end | ||
259 | end | ||
260 | do | ||
261 | local _type_0 = type(_u8868_u683c) | ||
262 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
263 | if _tab_0 then | ||
264 | local _u53d8_u91cfa = _u8868_u683c["变量a"] | ||
265 | local _u53d8_u91cfb = _u8868_u683c["变量b"] | ||
266 | if _u53d8_u91cfb == nil then | ||
267 | _u53d8_u91cfb = 2 | ||
268 | end | ||
269 | if _u53d8_u91cfa ~= nil then | ||
270 | _u6253_u5370("部分匹配", _u53d8_u91cfa, _u53d8_u91cfb) | ||
271 | end | ||
272 | end | ||
273 | end | ||
274 | do | ||
275 | local _type_0 = type(_u8868_u683c) | ||
276 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
277 | local _match_0 = false | ||
278 | if _tab_0 then | ||
279 | local _u53d8_u91cfa = _u8868_u683c["变量a"] | ||
280 | local _u53d8_u91cfb = _u8868_u683c["变量b"] | ||
281 | if _u53d8_u91cfa ~= nil and _u53d8_u91cfb ~= nil then | ||
282 | _match_0 = true | ||
283 | _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb) | ||
284 | end | ||
285 | end | ||
286 | if not _match_0 then | ||
287 | _u6253_u5370("没有匹配") | ||
288 | end | ||
289 | end | ||
290 | end | ||
291 | do | ||
292 | local _u8868_u683c = { | ||
293 | ["变量x"] = "abc" | ||
294 | } | ||
295 | do | ||
296 | local _type_0 = type(_u8868_u683c) | ||
297 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
298 | local _match_0 = false | ||
299 | if _tab_0 then | ||
300 | local _u53d8_u91cfx = _u8868_u683c["变量x"] | ||
301 | local _u53d8_u91cfy = _u8868_u683c["变量y"] | ||
302 | if _u53d8_u91cfx ~= nil and _u53d8_u91cfy ~= nil then | ||
303 | _match_0 = true | ||
304 | _u6253_u5370("变量x: " .. tostring(_u53d8_u91cfx) .. " 和 变量y: " .. tostring(_u53d8_u91cfy)) | ||
305 | end | ||
306 | end | ||
307 | if not _match_0 then | ||
308 | if _tab_0 then | ||
309 | local _u53d8_u91cfx = _u8868_u683c["变量x"] | ||
310 | if _u53d8_u91cfx ~= nil then | ||
311 | _u6253_u5370("只有 变量x: " .. tostring(_u53d8_u91cfx)) | ||
312 | end | ||
313 | end | ||
314 | end | ||
315 | end | ||
316 | end | ||
317 | do | ||
318 | local _u5339_u914d | ||
319 | do | ||
320 | local _exp_0 = _u8868_u683c | ||
321 | if 1 == _exp_0 then | ||
322 | _u5339_u914d = "1" | ||
323 | else | ||
324 | local _type_0 = type(_exp_0) | ||
325 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
326 | local _match_0 = false | ||
327 | if _tab_0 then | ||
328 | local _u53d8_u91cfx = _exp_0["变量x"] | ||
329 | if _u53d8_u91cfx ~= nil then | ||
330 | _match_0 = true | ||
331 | _u5339_u914d = _u53d8_u91cfx | ||
332 | end | ||
333 | end | ||
334 | if not _match_0 then | ||
335 | if false == _exp_0 then | ||
336 | _u5339_u914d = "false" | ||
337 | else | ||
338 | _u5339_u914d = nil | ||
339 | end | ||
340 | end | ||
341 | end | ||
342 | end | ||
343 | end | ||
344 | do | ||
345 | local _exp_0 = _u8868_u683c | ||
346 | if nil == _exp_0 then | ||
347 | return "无效" | ||
348 | else | ||
349 | do | ||
350 | local _type_0 = type(_exp_0) | ||
351 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
352 | local _match_0 = false | ||
353 | if _tab_0 then | ||
354 | local _u53d8_u91cfa = _exp_0["变量a"] | ||
355 | local _u53d8_u91cfb = _exp_0["变量b"] | ||
356 | if _u53d8_u91cfa ~= nil and _u53d8_u91cfb ~= nil then | ||
357 | _match_0 = true | ||
358 | return tostring(_u53d8_u91cfa + _u53d8_u91cfb) | ||
359 | end | ||
360 | end | ||
361 | if not _match_0 then | ||
362 | if 1 == _exp_0 or 2 == _exp_0 or 3 == _exp_0 or 4 == _exp_0 or 5 == _exp_0 then | ||
363 | return "数字 1 - 5" | ||
364 | else | ||
365 | local _match_1 = false | ||
366 | if _tab_0 then | ||
367 | local _u5339_u914d_u4efb_u4f55_u8868_u683c = _exp_0["匹配任何表格"] | ||
368 | if _u5339_u914d_u4efb_u4f55_u8868_u683c == nil then | ||
369 | _u5339_u914d_u4efb_u4f55_u8868_u683c = "后备" | ||
370 | end | ||
371 | _match_1 = true | ||
372 | return _u5339_u914d_u4efb_u4f55_u8868_u683c | ||
373 | end | ||
374 | if not _match_1 then | ||
375 | return "除非它不是一个表格,否则不应到达这里" | ||
376 | end | ||
377 | end | ||
378 | end | ||
379 | end | ||
380 | end | ||
381 | end | ||
382 | do | ||
383 | do | ||
384 | local _exp_0 = _u53d8_u91cfy | ||
385 | local _type_0 = type(_exp_0) | ||
386 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
387 | if _tab_0 then | ||
388 | local _u8868 = (function() | ||
389 | local _obj_0 = _exp_0["变量x"] | ||
390 | if _obj_0 ~= nil then | ||
391 | return getmetatable(_obj_0) | ||
392 | end | ||
393 | return nil | ||
394 | end)() | ||
395 | if _u8868 ~= nil then | ||
396 | _u6253_u5370(_u8868) | ||
397 | end | ||
398 | end | ||
399 | end | ||
400 | end | ||
401 | return nil | ||
diff --git a/spec/outputs/unicode/syntax.lua b/spec/outputs/unicode/syntax.lua new file mode 100644 index 0000000..664fa46 --- /dev/null +++ b/spec/outputs/unicode/syntax.lua | |||
@@ -0,0 +1,431 @@ | |||
1 | local _u53d8_u91cfa = 1 + 2 * 3 / 6 | ||
2 | local _u4e00_u5806, _u53bb, _u8fd9_u91cc | ||
3 | _u53d8_u91cfa, _u4e00_u5806, _u53bb, _u8fd9_u91cc = _u53e6_u5916, _u4e16_u754c, nil, nil | ||
4 | _u51fd_u6570(_u53c2_u65701, _u53c2_u65702, _u53e6_u5916, _u53c2_u65703) | ||
5 | local _u6211_u4eec | ||
6 | _u8fd9_u91cc, _u6211_u4eec = function() end, _u662f_u7684 | ||
7 | local _u8fd9_u4e2a, _u4e0d_u540c | ||
8 | _u8fd9_u4e2a, _u4e0d_u540c = function() | ||
9 | return _u65b9_u6cd5 | ||
10 | end, _u662f_u7684 | ||
11 | _u7238_u7238() | ||
12 | _u7238_u7238(_u4e3b) | ||
13 | _u4f60_u597d(_u4e00, _u4e8c)(); | ||
14 | (5 + 5)(_u4e16_u754c) | ||
15 | _u4e50_u8da3(_u53d8_u91cfa)(_u53d8_u91cfb) | ||
16 | _u4e50_u8da3(_u53d8_u91cfa)(_u53d8_u91cfb) | ||
17 | _u4e50_u8da3(_u53d8_u91cfa)(_u53d8_u91cfb, _u574f(_u4f60_u597d)) | ||
18 | _u4f60_u597d(_u4e16_u754c(_u4f60_u5728_u8fd9_u91cc_u505a_u4ec0_u4e48)) | ||
19 | _u4ec0_u4e48(_u8fd9_u4e2a)[3243](_u4e16_u754c, _u54ce_u5440) | ||
20 | _u6bdb_u8338_u8338[_u624b][_u662f](_u6076_u5fc3)(_u597d_u7684(_u597d_u7684[_u4e16_u754c])) | ||
21 | local _ = (_u5f97_u5230[_u67d0_u4e8b] + 5)[_u5e74] | ||
22 | local _u53d8_u91cfi, _u53d8_u91cfx = 200, 300 | ||
23 | local _u662f_u7684 = (1 + 5) * 3 | ||
24 | _u662f_u7684 = ((1 + 5) * 3) / 2 | ||
25 | _u662f_u7684 = ((1 + 5) * 3) / 2 + _u53d8_u91cfi % 100 | ||
26 | local _u54c7 = (1 + 2) * (3 + 4) * (4 + 5) | ||
27 | _ = function() | ||
28 | if _u67d0_u4e8b then | ||
29 | return 1, 2, 4 | ||
30 | end | ||
31 | return _u6253_u5370("你好") | ||
32 | end | ||
33 | _ = function() | ||
34 | if _u4f60_u597d then | ||
35 | return "你好", "世界" | ||
36 | else | ||
37 | return _u4e0d, _u65b9_u6cd5 | ||
38 | end | ||
39 | end | ||
40 | _ = function() | ||
41 | return 1, 2, 34 | ||
42 | end | ||
43 | return 5 + function() | ||
44 | return 4 + 2 | ||
45 | end | ||
46 | return 5 + (function() | ||
47 | return 4 | ||
48 | end) + 2 | ||
49 | _u6253_u5370(5 + function() | ||
50 | _ = 34 | ||
51 | return _u597d(_u7403) | ||
52 | end) | ||
53 | _u67d0_u4e8b('其他', "是") | ||
54 | _u67d0_u4e8b('其他') | ||
55 | _u67d0_u4e8b("其他") | ||
56 | _ = _u67d0_u4e8b([[嘿]]) * 2 | ||
57 | _ = _u67d0_u4e8b([======[嘿]======]) * 2 | ||
58 | _ = _u67d0_u4e8b[ [======[嘿]======]] * 2 | ||
59 | _, _ = _u67d0_u4e8b('其他'), 2 | ||
60 | _, _ = _u67d0_u4e8b("其他"), 2 | ||
61 | _, _ = _u67d0_u4e8b([[其他]]), 2 | ||
62 | _, _ = _u67d0_u4e8b[ [[其他]]], 2 | ||
63 | _u67d0_u4e8b('其他', 2) | ||
64 | _u67d0_u4e8b("其他", 2) | ||
65 | _u67d0_u4e8b([[其他]], 2) | ||
66 | _ = _u8fd9_u91cc(_u6211_u4eec)("去")[12123] | ||
67 | local _call_0 = _u5206_u88c2("abc xyz 123") | ||
68 | local _call_1 = _call_0["映射"](_call_0, "#") | ||
69 | _call_1["打印全部"](_call_1) | ||
70 | _ = f("")[_u53d8_u91cfa] | ||
71 | local _call_2 = f("") | ||
72 | _ = _call_2["变量b"](_call_2) | ||
73 | _ = f("")["变量c"]() | ||
74 | f(("")[_u53d8_u91cfa]) | ||
75 | f((function() | ||
76 | local _call_3 = ("") | ||
77 | return _call_3["变量b"](_call_3) | ||
78 | end)()) | ||
79 | f(("")["变量c"]()) | ||
80 | local _call_3 = _u5217_u8868({ | ||
81 | "abc", | ||
82 | "xyz", | ||
83 | "123" | ||
84 | }) | ||
85 | local _call_4 = _call_3["映射"](_call_3, "#") | ||
86 | _call_4["打印全部"](_call_4) | ||
87 | _ = f({ })[_u53d8_u91cfa] | ||
88 | local _call_5 = f({ }) | ||
89 | _ = _call_5["变量b"](_call_5) | ||
90 | _ = f({ })["变量c"]() | ||
91 | local _u67d0_u4e8b = { | ||
92 | ["测试"] = 12323, | ||
93 | ["什么"] = function() | ||
94 | return _u6253_u5370("你好 世界") | ||
95 | end | ||
96 | } | ||
97 | _u6253_u5370(_u67d0_u4e8b["测试"]) | ||
98 | local _u5929_u54ea = { | ||
99 | ["你好"] = "世界" | ||
100 | } | ||
101 | local _u6c29 = { | ||
102 | ["数字"] = 100, | ||
103 | ["世界"] = function(_u81ea_u5df1) | ||
104 | _u6253_u5370(_u81ea_u5df1["数字"]) | ||
105 | return { | ||
106 | ["某事"] = function() | ||
107 | return _u6253_u5370("嗨 从某事") | ||
108 | end | ||
109 | } | ||
110 | end, | ||
111 | ["某事"] = function(_u81ea_u5df1, _u5b57_u7b26_u4e32) | ||
112 | _u6253_u5370("字符串是", _u5b57_u7b26_u4e32) | ||
113 | return { | ||
114 | ["世界"] = function(_u53d8_u91cfa, _u53d8_u91cfb) | ||
115 | return _u6253_u5370("总和", _u53d8_u91cfa + _u53d8_u91cfb) | ||
116 | end | ||
117 | } | ||
118 | end | ||
119 | } | ||
120 | _u67d0_u4e8b["什么"]() | ||
121 | _u6c29["世界"](_u6c29)["某事"]() | ||
122 | _u6c29["某事"](_u6c29, "200")["世界"](1, 2) | ||
123 | _u53d8_u91cfx = -434 | ||
124 | _u53d8_u91cfx = -_u4f60_u597d(_u4e16_u754c(_u4e00(_u4e8c))) | ||
125 | local _u55e8 = -"herfef" | ||
126 | _u53d8_u91cfx = -(function() | ||
127 | local _accum_0 = { } | ||
128 | local _len_0 = 1 | ||
129 | for _u53d8_u91cfx in _u53d8_u91cfx do | ||
130 | _accum_0[_len_0] = _u53d8_u91cfx | ||
131 | _len_0 = _len_0 + 1 | ||
132 | end | ||
133 | return _accum_0 | ||
134 | end)() | ||
135 | if _u9177 then | ||
136 | _u6253_u5370("你好") | ||
137 | end | ||
138 | if not _u9177 then | ||
139 | _u6253_u5370("你好") | ||
140 | end | ||
141 | if not (1212 and 3434) then | ||
142 | _u6253_u5370("你好") | ||
143 | end | ||
144 | for i = 1, 10 do | ||
145 | _u6253_u5370("你好") | ||
146 | end | ||
147 | _u6253_u5370("疯子") | ||
148 | if _u4f60_u597d then | ||
149 | _ = 343 | ||
150 | end | ||
151 | if _u9177 then | ||
152 | _u6253_u5370("什么") | ||
153 | end | ||
154 | while not (function() | ||
155 | local _call_6 = _u9605_u8bfb_u8005 | ||
156 | return _call_6["结束"](_call_6) | ||
157 | end)() do | ||
158 | local _call_6 = _u9605_u8bfb_u8005 | ||
159 | _call_6["解析_行"](_call_6) | ||
160 | end | ||
161 | while not (function() | ||
162 | local _call_6 = _u9605_u8bfb_u8005 | ||
163 | return _call_6["结束"](_call_6) | ||
164 | end)() do | ||
165 | local _call_6 = _u9605_u8bfb_u8005 | ||
166 | _call_6["解析_行"](_call_6) | ||
167 | end | ||
168 | (function(...) | ||
169 | local _u53c2_u6570 = { | ||
170 | ... | ||
171 | } | ||
172 | end)() | ||
173 | _u53d8_u91cfx = function(...) | ||
174 | return dump({ | ||
175 | ... | ||
176 | }) | ||
177 | end | ||
178 | _u53d8_u91cfx = not true | ||
179 | local _u53d8_u91cfy = not (5 + 5) | ||
180 | _u53d8_u91cfy = #"你好" | ||
181 | _u53d8_u91cfx = #{ | ||
182 | #{ }, | ||
183 | #{ | ||
184 | 1 | ||
185 | }, | ||
186 | #{ | ||
187 | 1, | ||
188 | 2 | ||
189 | } | ||
190 | } | ||
191 | _, _ = _u4f60_u597d, _u4e16_u754c | ||
192 | _u67d0_u4e8b["你好"](_u67d0_u4e8b, _u4ec0_u4e48)(_u53d8_u91cfa, _u53d8_u91cfb) | ||
193 | _u67d0_u4e8b["你好"](_u67d0_u4e8b, _u4ec0_u4e48) | ||
194 | local _call_6 = _u67d0_u4e8b["你好"] | ||
195 | _call_6["世界"](_call_6, _u53d8_u91cfa, _u53d8_u91cfb) | ||
196 | local _call_7 = _u67d0_u4e8b["你好"] | ||
197 | _call_7["世界"](_call_7, 1, 2, 3)(_u53d8_u91cfa, _u53d8_u91cfb) | ||
198 | _u53d8_u91cfx = 1232 | ||
199 | _u53d8_u91cfx = _u53d8_u91cfx + (10 + 3) | ||
200 | local _u53d8_u91cfj = _u53d8_u91cfj - "你好" | ||
201 | _u53d8_u91cfy = _u53d8_u91cfy * 2 | ||
202 | _u53d8_u91cfy = _u53d8_u91cfy / 100 | ||
203 | _u53d8_u91cfy = _u53d8_u91cfy // 100 | ||
204 | local _u53d8_u91cfm = _u53d8_u91cfm % 2 | ||
205 | local _u4f60_u597d = _u4f60_u597d .. "世界" | ||
206 | self.__class["某事"] = self.__class["某事"] + 10 | ||
207 | self["某事"] = self["某事"] + 10 | ||
208 | local _update_0 = "你好" | ||
209 | _u53d8_u91cfa[_update_0] = _u53d8_u91cfa[_update_0] + 10 | ||
210 | local _update_1 = "你好" .. tostring(tostring(ff)) | ||
211 | _u53d8_u91cfa[_update_1] = _u53d8_u91cfa[_update_1] + 10 | ||
212 | local _obj_0 = _u53d8_u91cfa[_u56db] | ||
213 | _obj_0["字段x"] = _obj_0["字段x"] + 10 | ||
214 | _u53d8_u91cfa["变量b"] = _u53d8_u91cfa["变量b"] + 1 | ||
215 | local _obj_1 = _u53d8_u91cfa["变量b"][1]["变量c"] | ||
216 | local _update_2 = 2 + 3 | ||
217 | _obj_1[_update_2] = _obj_1[_update_2] + 1 | ||
218 | do | ||
219 | local _with_0 = _u8868 | ||
220 | local _obj_2 = _with_0["字段a"] | ||
221 | _obj_2["变量c"] = _obj_2["变量c"] + 1 | ||
222 | end | ||
223 | do | ||
224 | local _obj_2 = _u8868 | ||
225 | _obj_2[#_obj_2 + 1] = 10 | ||
226 | end | ||
227 | do | ||
228 | local _obj_2 = _u53d8_u91cfa["变量b"]["变量c"] | ||
229 | _obj_2[#_obj_2 + 1] = 1 | ||
230 | end | ||
231 | if _u6761_u4ef6v then | ||
232 | _u53d8_u91cfx[#_u53d8_u91cfx + 1] = 1 | ||
233 | else | ||
234 | _u53d8_u91cfx[#_u53d8_u91cfx + 1] = 2 | ||
235 | end | ||
236 | do | ||
237 | local _with_0 = _u8868 | ||
238 | do | ||
239 | local _obj_2 = _with_0["变量b"]["变量c"] | ||
240 | do | ||
241 | local _with_1 = _u5411_u91cf | ||
242 | _with_1["字段x"] = 1 | ||
243 | _with_1["字段y"] = 2 | ||
244 | _obj_2[#_obj_2 + 1] = _with_1 | ||
245 | end | ||
246 | end | ||
247 | end | ||
248 | do | ||
249 | local _call_8 = _u5bf9_u8c61a["变量b"]["变量c"]["变量d"] | ||
250 | local _obj_2 = _call_8["函数"](_call_8)["变量g"] | ||
251 | _obj_2[#_obj_2 + 1] = 1 | ||
252 | end | ||
253 | local _u8868 = { } | ||
254 | _u8868[#_u8868 + 1] = 1 | ||
255 | _u8868[#_u8868 + 1] = 2 | ||
256 | _u8868[#_u8868 + 1] = 3 | ||
257 | _u53d8_u91cfx = 0 | ||
258 | local _list_0 = _u503c | ||
259 | for _index_0 = 1, #_list_0 do | ||
260 | local _u53d8_u91cfv = _list_0[_index_0] | ||
261 | if ntype(_u53d8_u91cfv) == "函数定义" then | ||
262 | _ = _u53d8_u91cfx + 1 | ||
263 | end | ||
264 | end | ||
265 | _u4f60_u597d = { | ||
266 | ["某物"] = _u4e16_u754c, | ||
267 | ["如果"] = "你好", | ||
268 | ["否则"] = 3434, | ||
269 | ["函数"] = "好的", | ||
270 | ["好的"] = 230203 | ||
271 | } | ||
272 | _u8868 = { | ||
273 | ["执行"] = _u53d8_u91cfb, | ||
274 | _u6267_u884c({ | ||
275 | ["变量b"] = _u53d8_u91cfb | ||
276 | }) | ||
277 | } | ||
278 | div({ | ||
279 | ["类"] = "酷" | ||
280 | }) | ||
281 | _ = 5 + _u4ec0_u4e48(_u65e0_u804a) | ||
282 | _u4ec0_u4e48(_u65e0_u804a + 5) | ||
283 | _ = 5 - _u4ec0_u4e48(_u65e0_u804a) | ||
284 | _u4ec0_u4e48(_u65e0_u804a - 5) | ||
285 | _u53d8_u91cfx = _u4f60_u597d - _u4e16_u754c - _u67d0_u7269; | ||
286 | (function(_u67d0_u7269) | ||
287 | if _u67d0_u7269 == nil then | ||
288 | _u67d0_u7269 = _u4e0e((function() | ||
289 | local _call_8 = _u4ec0_u4e48 | ||
290 | return _call_8["酷"](_call_8, 100) | ||
291 | end)()) | ||
292 | end | ||
293 | return _u6253_u5370(_u67d0_u7269) | ||
294 | end)() | ||
295 | if _u67d0_u7269 then | ||
296 | _ = 03589 | ||
297 | else | ||
298 | _ = 3434 | ||
299 | end | ||
300 | if _u67d0_u7269 then | ||
301 | _ = _u662f_u7684 | ||
302 | elseif "嗯嗯嗯" then | ||
303 | _u6253_u5370("酷") | ||
304 | else | ||
305 | _ = _u597d_u7684 | ||
306 | end | ||
307 | _u53d8_u91cfx = _u4e0d_u662f_u67d0_u7269 | ||
308 | _u53d8_u91cfy = _u5982_u679c_u67d0_u7269 | ||
309 | local _u53d8_u91cfz = _u53d8_u91cfx(_u4e0e(_u53d8_u91cfb)) | ||
310 | _u53d8_u91cfz = _u53d8_u91cfx(_u4e0eb) | ||
311 | while 10 > _u67d0_u7269({ | ||
312 | ["某物"] = "世界" | ||
313 | }) do | ||
314 | _u6253_u5370("是的") | ||
315 | end | ||
316 | _u53d8_u91cfx = { | ||
317 | ["好的"] = _u786e_u5b9a | ||
318 | } | ||
319 | _u662f_u7684({ | ||
320 | ["好的"] = _u7537_u4eba, | ||
321 | ["确定"] = _u5148_u751f | ||
322 | }) | ||
323 | _u4f60_u597d("无逗号", { | ||
324 | ["是的"] = _u7238_u7238, | ||
325 | ["另一个"] = _u4e16_u754c | ||
326 | }) | ||
327 | _u4f60_u597d("逗号", { | ||
328 | ["某物"] = _u4f60_u597d__u4e16_u754c, | ||
329 | ["骂人"] = _u4f60 | ||
330 | }) | ||
331 | _u53e6_u4e00_u4e2a(_u4f60_u597d, _u4e00_u4e2a, _u4e8c, _u4e09, _u56db, { | ||
332 | ["是的"] = _u7537_u4eba, | ||
333 | ["好的"] = _u662f_u7684, | ||
334 | ["好"] = _u597d_u7684 | ||
335 | }) | ||
336 | _u53e6_u4e00_u4e2a(_u4f60_u597d, _u4e00_u4e2a, _u4e8c, _u4e09, _u56db, { | ||
337 | ["是的"] = _u7537_u4eba, | ||
338 | ["好的"] = _u662f_u7684, | ||
339 | { | ||
340 | ["好"] = _u597d_u7684, | ||
341 | ["好的"] = 1 | ||
342 | }, | ||
343 | { | ||
344 | ["好"] = _u597d_u7684, | ||
345 | ["好的"] = 2 | ||
346 | } | ||
347 | }) | ||
348 | _u53e6_u4e00_u4e2a(_u4f60_u597d, _u4e00_u4e2a, _u4e8c, _u4e09, _u56db, { | ||
349 | ["是的"] = _u7537_u4eba, | ||
350 | ["好的"] = _u662f_u7684 | ||
351 | }) | ||
352 | _u53e6_u4e00_u4e2a(_u4f60_u597d, _u4e00_u4e2a, _u4e8c, _u4e09, _u56db, { | ||
353 | ["是的"] = _u7537_u4eba({ | ||
354 | ["好的"] = _u662f_u7684 | ||
355 | }) | ||
356 | }) | ||
357 | _u963f_u8d3e_u514b_u65af(_u5730_u5740, function(_u6570_u636e) | ||
358 | return _u5904_u7406(_u6570_u636e) | ||
359 | end, function(_u9519_u8bef) | ||
360 | return _u6253_u5370(_u9519_u8bef) | ||
361 | end) | ||
362 | _u53d8_u91cfa = _u53d8_u91cfa + (3 - 5) | ||
363 | _u53d8_u91cfa = _u53d8_u91cfa * (3 + 5) | ||
364 | _u53d8_u91cfa = _u53d8_u91cfa * 3 | ||
365 | _u53d8_u91cfa = _u53d8_u91cfa >> 3 | ||
366 | _u53d8_u91cfa = _u53d8_u91cfa << 3 | ||
367 | _u53d8_u91cfa = _u53d8_u91cfa / _u51fd_u6570("酷") | ||
368 | _u53d8_u91cfx["然后"] = "你好" | ||
369 | _u53d8_u91cfx["当"]["真"] = "你好" | ||
370 | _u53d8_u91cfx["当"]["真"] = "你好" | ||
371 | _u53d8_u91cfx = _u53d8_u91cfx or "你好" | ||
372 | _u53d8_u91cfx = _u53d8_u91cfx and "你好" | ||
373 | _u53d8_u91cfz = _u53d8_u91cfa - _u53d8_u91cfb | ||
374 | _u53d8_u91cfz = _u53d8_u91cfa(-_u53d8_u91cfb) | ||
375 | _u53d8_u91cfz = _u53d8_u91cfa - _u53d8_u91cfb | ||
376 | _u53d8_u91cfz = _u53d8_u91cfa - _u53d8_u91cfb | ||
377 | local _u5b57_u7b26_u4e32 = _u5b57_u7b26_u4e32A .. _u5b57_u7b26_u4e32B .. _u5b57_u7b26_u4e32C | ||
378 | _u51fd_u6570(3000, "192.168.1.1") | ||
379 | local f | ||
380 | f = function() | ||
381 | return _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd, _u53d8_u91cfe, _u53d8_u91cff | ||
382 | end | ||
383 | f = function() | ||
384 | return _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd, _u53d8_u91cfe, _u53d8_u91cff | ||
385 | end | ||
386 | do | ||
387 | local _with_0 = _u5bf9_u8c61 | ||
388 | _u8c03_u7528(_with_0["函数"](_with_0), 123, "abc") | ||
389 | end | ||
390 | _u8c03_u7528A(_u8c03_u7528B(_u8c03_u7528C(123))) | ||
391 | _u8c03_u7528A(_u8c03_u7528B(_u8c03_u7528C(123))) | ||
392 | local _u53d8_u91cfv = { | ||
393 | _u53d8_u91cfa(-1), | ||
394 | _u53d8_u91cfa(-1), | ||
395 | _u53d8_u91cfa - 1, | ||
396 | _u53d8_u91cfa - 1, | ||
397 | _u53d8_u91cfa - 1, | ||
398 | _u53d8_u91cfa - 1, | ||
399 | _u53d8_u91cfa - 1, | ||
400 | _u53d8_u91cfa - 1, | ||
401 | _u53d8_u91cfa(~1), | ||
402 | _u53d8_u91cfa(~1), | ||
403 | _u53d8_u91cfa ~ 1, | ||
404 | _u53d8_u91cfa ~ 1, | ||
405 | _u53d8_u91cfa ~ 1, | ||
406 | _u53d8_u91cfa ~ 1, | ||
407 | _u53d8_u91cfa ~ 1, | ||
408 | _u53d8_u91cfa ~ 1 | ||
409 | } | ||
410 | do | ||
411 | _u53d8_u91cfa = 1 + 2 * 3 / 4 | ||
412 | local _u53d8_u91cf_1 = f1(-1 + 2 + 3) | ||
413 | local _u53d8_u91cf_2 = f1 - 1 + 2 + 3 | ||
414 | local f2 | ||
415 | f2 = function(_u53d8_u91cfx) | ||
416 | return _u6253_u5370(_u53d8_u91cfx + 1) | ||
417 | end | ||
418 | _u53d8_u91cfa = f2() | ||
419 | f2(-1) | ||
420 | _u53d8_u91cfa = f2() - f2(1) | ||
421 | local _u53d8_u91cf_3, _u53d8_u91cf_4 | ||
422 | _u53d8_u91cf_1, _u53d8_u91cf_2, _u53d8_u91cf_3, _u53d8_u91cf_4 = 1, f(2, 3, f(4, 4)) | ||
423 | end | ||
424 | do | ||
425 | f = function(_u53d8_u91cfa, _u53d8_u91cfb) | ||
426 | return _u53d8_u91cfa + _u53d8_u91cfb | ||
427 | end | ||
428 | f(_u53d8_u91cfa, _u53d8_u91cfb) | ||
429 | f() | ||
430 | end | ||
431 | return nil | ||
diff --git a/spec/outputs/unicode/tables.lua b/spec/outputs/unicode/tables.lua new file mode 100644 index 0000000..28ad6e2 --- /dev/null +++ b/spec/outputs/unicode/tables.lua | |||
@@ -0,0 +1,594 @@ | |||
1 | local _u80cc_u5305 = { | ||
2 | ["东西"] = { | ||
3 | ["是的"] = 200, | ||
4 | ["他们"] = function() | ||
5 | print("你好") | ||
6 | return _u4f60_u7684_u811a("小") | ||
7 | end, | ||
8 | ["美丽"] = _u5934_u53d1_u53d8_u91cf, | ||
9 | ["金"] = _u55ef_u53d8_u91cf | ||
10 | }, | ||
11 | ["您"] = 1000, | ||
12 | ["吃"] = goo_u53d8_u91cf, | ||
13 | ["是的"] = dudd_u53d8_u91cf | ||
14 | } | ||
15 | local _u5f00_u59cb = { | ||
16 | ["东西"] = "冷" | ||
17 | } | ||
18 | local _u6d74 = { | ||
19 | ["开"] = "火" | ||
20 | } | ||
21 | local _u53e6_u4e00_u4e2a = { | ||
22 | [4] = 232, | ||
23 | ["好食物"] = "是最好的" | ||
24 | } | ||
25 | local fwip_u53d8_u91cf = { | ||
26 | ["东西"] = _u4f60_u597d("什么"), | ||
27 | ["数字"] = 2323, | ||
28 | ["什么"] = yo_u53d8_u91cf("妈妈", "是的"), | ||
29 | ["水果"] = basket_u53d8_u91cf, | ||
30 | ["坚果"] = day_u53d8_u91cf | ||
31 | } | ||
32 | local frick_u53d8_u91cf = { | ||
33 | ["你好"] = "世界" | ||
34 | } | ||
35 | local frack_u53d8_u91cf, _u6700_u597d = { | ||
36 | ["你好"] = "世界", | ||
37 | ["米饭"] = 3434 | ||
38 | }, "什么" | ||
39 | local ya_u53d8_u91cf = { | ||
40 | 1, | ||
41 | 2, | ||
42 | 3, | ||
43 | ["键"] = 100, | ||
44 | 343, | ||
45 | "你好", | ||
46 | ["嗯"] = 232 | ||
47 | } | ||
48 | local x_u53d8_u91cf = { | ||
49 | 1, | ||
50 | 2, | ||
51 | 4343, | ||
52 | 343, | ||
53 | 343 | ||
54 | } | ||
55 | local g_u53d8_u91cf, p_u53d8_u91cf = { | ||
56 | 1, | ||
57 | 2, | ||
58 | ["nowy变量"] = "是", | ||
59 | 3, | ||
60 | 4, | ||
61 | ["嘿"] = 232, | ||
62 | ["另一个"] = "天" | ||
63 | }, 234 | ||
64 | local annother_u53d8_u91cf = { | ||
65 | 1, | ||
66 | 2, | ||
67 | 3, | ||
68 | 3, | ||
69 | 4, | ||
70 | 5, | ||
71 | 6, | ||
72 | 7, | ||
73 | 8 | ||
74 | } | ||
75 | local _u662f_u7684_u53d8_u91cf = { | ||
76 | [232] = 3434, | ||
77 | "你好", | ||
78 | ["冰"] = "蛋糕" | ||
79 | } | ||
80 | local whatabout_u53d8_u91cf = { | ||
81 | _u4f60_u597d(_u4e16_u754c, _u53e6_u4e00_u4e2a_u53d8_u91cf), | ||
82 | _u4ec0_u4e48, | ||
83 | _u5173_u4e8e, | ||
84 | _u73b0_u5728, | ||
85 | _u4f60_u597d("世界"), | ||
86 | _u662f_u7684_u53d8_u91cf, | ||
87 | _u4f60_u597d("世界", _u662f_u7684_u53d8_u91cf) | ||
88 | } | ||
89 | x_u53d8_u91cf = { | ||
90 | ["东西"] = function(self) | ||
91 | return "你好" | ||
92 | end, | ||
93 | ["酷"] = { | ||
94 | ["床"] = { | ||
95 | 2323, | ||
96 | 2323 | ||
97 | }, | ||
98 | ["红"] = 2343 | ||
99 | }, | ||
100 | ["名字"] = function(self, node_u53d8_u91cf) | ||
101 | return self:value(node_u53d8_u91cf) | ||
102 | end | ||
103 | } | ||
104 | x_u53d8_u91cf = { | ||
105 | ["东西"] = _u4e1c_u897f, | ||
106 | ["东西"] = _u4e1c_u897f_u53d8_u91cf | ||
107 | } | ||
108 | local y_u53d8_u91cf = { | ||
109 | ["你好"] = _u4f60_u597d, | ||
110 | ["那里"] = _u90a3_u91cc, | ||
111 | ["怎么样"] = _u600e_u4e48_u6837, | ||
112 | ["你"] = _u4f60, | ||
113 | ["事情"] = _u4e8b_u60c5 | ||
114 | } | ||
115 | _u7535_u8bdd_u6211("你好", { | ||
116 | ["x变量"] = x_u53d8_u91cf, | ||
117 | ["y变量"] = y_u53d8_u91cf, | ||
118 | ["z变量"] = z_u53d8_u91cf | ||
119 | }) | ||
120 | local t_u53d8_u91cf = { | ||
121 | ["a变量"] = 'a', | ||
122 | [b_u53d8_u91cf] = 'b' | ||
123 | } | ||
124 | local xam_u53d8_u91cf = { | ||
125 | ["你好"] = 1234, | ||
126 | ["你好"] = 12354, | ||
127 | [ [[你好变量]]] = 12354, | ||
128 | ["你好"] = 12354, | ||
129 | [ [[你好变量]]] = 12354 | ||
130 | } | ||
131 | local kam_u53d8_u91cf = { | ||
132 | ["你好"] = 12, | ||
133 | ["好奶酪"] = "嗯", | ||
134 | ["是的"] = 12 + 232, | ||
135 | ["让我们"] = keepit({ | ||
136 | ["继续"] = _u771f_u7684, | ||
137 | ["好的"] = "是的" | ||
138 | }), | ||
139 | ["更多"] = { | ||
140 | 1, | ||
141 | (function() | ||
142 | local _accum_0 = { } | ||
143 | local _len_0 = 1 | ||
144 | for x_u53d8_u91cf = 1, 10 do | ||
145 | _accum_0[_len_0] = x_u53d8_u91cf | ||
146 | _len_0 = _len_0 + 1 | ||
147 | end | ||
148 | return _accum_0 | ||
149 | end)() | ||
150 | }, | ||
151 | [{ | ||
152 | "一个", | ||
153 | "两个" | ||
154 | }] = _u4e00_u4ef6_u4e8b_u60c5(function(self) end) | ||
155 | } | ||
156 | keepit({ | ||
157 | ["继续"] = _u771f_u7684, | ||
158 | ["好的"] = "是的", | ||
159 | ["workd变量"] = "好的" | ||
160 | }) | ||
161 | _u4e8b_u60c5({ | ||
162 | ["什么"] = "伟大", | ||
163 | ["没有"] = "更多", | ||
164 | ["好的"] = 123 | ||
165 | }) | ||
166 | _u4e8b_u60c5({ | ||
167 | ["什么"] = "伟大", | ||
168 | ["没有"] = "更多" | ||
169 | }) | ||
170 | local __u53d8_u91cf = { | ||
171 | ["好的"] = 123 | ||
172 | } | ||
173 | local k_u53d8_u91cf = { | ||
174 | ["你好"] = "世界" | ||
175 | } | ||
176 | k_u53d8_u91cf = { | ||
177 | ['你好'] = '世界' | ||
178 | } | ||
179 | k_u53d8_u91cf = { | ||
180 | ["你好"] = '世界', | ||
181 | ["帽子"] = "zat变量" | ||
182 | } | ||
183 | _u8bf7({ | ||
184 | ["你好"] = "世界" | ||
185 | }) | ||
186 | k_u53d8_u91cf = { | ||
187 | ["你好"] = "世界", | ||
188 | ["一个"] = "区域" | ||
189 | } | ||
190 | local f1_u53d8_u91cf, f2_u53d8_u91cf, f3_u53d8_u91cf = "一个", { | ||
191 | ["两个"] = three_u53d8_u91cf | ||
192 | }, "四" | ||
193 | f1_u53d8_u91cf, f2_u53d8_u91cf = { | ||
194 | ["两个"] = three_u53d8_u91cf | ||
195 | }, "四" | ||
196 | f1_u53d8_u91cf = { | ||
197 | "一个", | ||
198 | ["两个"] = three_u53d8_u91cf, | ||
199 | "四" | ||
200 | } | ||
201 | local j1_u53d8_u91cf, j2_u53d8_u91cf, j3_u53d8_u91cf, j4_u53d8_u91cf = "一个", { | ||
202 | ["两个"] = three_u53d8_u91cf, | ||
203 | ["四"] = five_u53d8_u91cf | ||
204 | }, 6, 7 | ||
205 | local _u5973_u82f1_u96c4 = { | ||
206 | ["名字"] = "克里斯蒂娜", | ||
207 | ["年龄"] = 18, | ||
208 | ["工作"] = "公主", | ||
209 | ["喜欢"] = { | ||
210 | { | ||
211 | ["名字"] = "小猫", | ||
212 | ["img变量"] = "/image/kittens.png" | ||
213 | }, | ||
214 | { | ||
215 | ["名字"] = "花", | ||
216 | ["img变量"] = "/image/flower.png" | ||
217 | } | ||
218 | }, | ||
219 | ["物品"] = { | ||
220 | { | ||
221 | ["名字"] = "戒指", | ||
222 | ["数量"] = 2 | ||
223 | }, | ||
224 | { | ||
225 | ["名字"] = "项链", | ||
226 | ["数量"] = 1 | ||
227 | } | ||
228 | }, | ||
229 | ["状态"] = { | ||
230 | ["desc变量"] = "弱", | ||
231 | { | ||
232 | ["属性"] = "健康", | ||
233 | ["价值"] = 50 | ||
234 | }, | ||
235 | { | ||
236 | ["属性"] = "魔法", | ||
237 | ["价值"] = 100 | ||
238 | } | ||
239 | } | ||
240 | } | ||
241 | local _u5e93_u5b58 = { | ||
242 | ["设备"] = { | ||
243 | "剑", | ||
244 | "盾" | ||
245 | }, | ||
246 | ["物品"] = { | ||
247 | { | ||
248 | ["名字"] = "药水", | ||
249 | ["计数"] = 10 | ||
250 | }, | ||
251 | { | ||
252 | ["名字"] = "面包", | ||
253 | ["计数"] = 3 | ||
254 | } | ||
255 | } | ||
256 | } | ||
257 | local _u7269_u54c1 = { | ||
258 | _u51fd_u6570(), | ||
259 | (function() | ||
260 | local _with_0 = _u53d8_u91cftb | ||
261 | _with_0.abc = 123 | ||
262 | return _with_0 | ||
263 | end)(), | ||
264 | { | ||
265 | 1, | ||
266 | 2, | ||
267 | 3 | ||
268 | }, | ||
269 | _u51fd_u6570({ | ||
270 | 1, | ||
271 | 2, | ||
272 | 3 | ||
273 | }), | ||
274 | _u51fd_u6570({ | ||
275 | 1, | ||
276 | 2, | ||
277 | 3 | ||
278 | }), | ||
279 | (function() | ||
280 | local _accum_0 = { } | ||
281 | local _len_0 = 1 | ||
282 | for _u53d8_u91cfi = 1, 3 do | ||
283 | _accum_0[_len_0] = _u53d8_u91cfi | ||
284 | _len_0 = _len_0 + 1 | ||
285 | end | ||
286 | return _accum_0 | ||
287 | end)(), | ||
288 | tostring((function() | ||
289 | if _u53d8_u91cfa then | ||
290 | return _u53d8_u91cfb | ||
291 | end | ||
292 | end)()) | ||
293 | } | ||
294 | local _u53cc_u9879 = { | ||
295 | { | ||
296 | "国王", | ||
297 | "王后" | ||
298 | }, | ||
299 | { | ||
300 | "英雄", | ||
301 | "公主" | ||
302 | } | ||
303 | } | ||
304 | _u7269_u54c1 = { | ||
305 | { | ||
306 | ["名称"] = "戒指", | ||
307 | ["数量"] = 2 | ||
308 | }, | ||
309 | { | ||
310 | ["名称"] = "项链", | ||
311 | ["数量"] = 1 | ||
312 | } | ||
313 | } | ||
314 | local _u83dc_u5355 = { | ||
315 | { | ||
316 | ["文本"] = "保存", | ||
317 | ["子菜单"] = { | ||
318 | { | ||
319 | ["文本"] = "插槽1:" .. (_u63d2_u69fd[1]["名称"] or "无"), | ||
320 | ["点击"] = function() end | ||
321 | }, | ||
322 | { | ||
323 | ["文本"] = { | ||
324 | "插槽2" | ||
325 | }, | ||
326 | ["点击"] = function() end | ||
327 | }, | ||
328 | { | ||
329 | ["文本"] = [[插槽3]], | ||
330 | ["点击"] = function() end | ||
331 | }, | ||
332 | { | ||
333 | ["文本"] = (function() | ||
334 | local _call_0 = ("插槽4") | ||
335 | return _call_0["名称"](_call_0) | ||
336 | end)(), | ||
337 | ["点击"] = function() end | ||
338 | }, | ||
339 | { | ||
340 | ["文本"] = (function() | ||
341 | local _call_0 = ({ | ||
342 | { | ||
343 | "插槽5" | ||
344 | } | ||
345 | })[1] | ||
346 | return _call_0["名称"](_call_0) | ||
347 | end)(), | ||
348 | ["点击"] = function() end | ||
349 | }, | ||
350 | [6] = { | ||
351 | ["文本"] = ("插槽6"), | ||
352 | ["点击"] = function() end | ||
353 | } | ||
354 | } | ||
355 | } | ||
356 | } | ||
357 | local _u53d8_u91cftb | ||
358 | do | ||
359 | local _tab_0 = { } | ||
360 | local _idx_0 = 1 | ||
361 | for _key_0, _value_0 in pairs(_u5176_u4ed6) do | ||
362 | if _idx_0 == _key_0 then | ||
363 | _tab_0[#_tab_0 + 1] = _value_0 | ||
364 | _idx_0 = _idx_0 + 1 | ||
365 | else | ||
366 | _tab_0[_key_0] = _value_0 | ||
367 | end | ||
368 | end | ||
369 | _u53d8_u91cftb = _tab_0 | ||
370 | end | ||
371 | local tb_u6df7_u5408 | ||
372 | do | ||
373 | local _tab_0 = { | ||
374 | 1, | ||
375 | 2, | ||
376 | 3 | ||
377 | } | ||
378 | local _obj_0 | ||
379 | _u7269_u54c1.x = 1 | ||
380 | _u7269_u54c1["函数"](_u7269_u54c1) | ||
381 | _obj_0 = _u7269_u54c1 | ||
382 | local _idx_0 = 1 | ||
383 | for _key_0, _value_0 in pairs(_obj_0) do | ||
384 | if _idx_0 == _key_0 then | ||
385 | _tab_0[#_tab_0 + 1] = _value_0 | ||
386 | _idx_0 = _idx_0 + 1 | ||
387 | else | ||
388 | _tab_0[_key_0] = _value_0 | ||
389 | end | ||
390 | end | ||
391 | _tab_0[#_tab_0 + 1] = "a" | ||
392 | _tab_0[#_tab_0 + 1] = "b" | ||
393 | _tab_0[#_tab_0 + 1] = "c" | ||
394 | local _obj_1 | ||
395 | do | ||
396 | local _obj_2 = _u51fd_u6570 | ||
397 | if _obj_2 ~= nil then | ||
398 | _obj_1 = _obj_2() | ||
399 | end | ||
400 | end | ||
401 | local _idx_1 = 1 | ||
402 | for _key_0, _value_0 in pairs(_obj_1) do | ||
403 | if _idx_1 == _key_0 then | ||
404 | _tab_0[#_tab_0 + 1] = _value_0 | ||
405 | _idx_1 = _idx_1 + 1 | ||
406 | else | ||
407 | _tab_0[_key_0] = _value_0 | ||
408 | end | ||
409 | end | ||
410 | _tab_0["键"] = "值" | ||
411 | for _index_0 = 1, select('#', ...) do | ||
412 | _tab_0[#_tab_0 + 1] = select(_index_0, ...) | ||
413 | end | ||
414 | tb_u6df7_u5408 = _tab_0 | ||
415 | end | ||
416 | local tb_u6df7_u5408A | ||
417 | do | ||
418 | local _tab_0 = { } | ||
419 | local _obj_0 | ||
420 | do | ||
421 | local _accum_0 = { } | ||
422 | local _len_0 = 1 | ||
423 | for _u53d8_u91cfi = 1, 10 do | ||
424 | _accum_0[_len_0] = _u53d8_u91cfi | ||
425 | _len_0 = _len_0 + 1 | ||
426 | end | ||
427 | _obj_0 = _accum_0 | ||
428 | end | ||
429 | local _idx_0 = 1 | ||
430 | for _key_0, _value_0 in pairs(_obj_0) do | ||
431 | if _idx_0 == _key_0 then | ||
432 | _tab_0[#_tab_0 + 1] = _value_0 | ||
433 | _idx_0 = _idx_0 + 1 | ||
434 | else | ||
435 | _tab_0[_key_0] = _value_0 | ||
436 | end | ||
437 | end | ||
438 | _tab_0[#_tab_0 + 1] = 11 | ||
439 | tb_u6df7_u5408A = _tab_0 | ||
440 | end | ||
441 | local tb_u6df7_u5408B | ||
442 | do | ||
443 | local _tab_0 = { } | ||
444 | local _obj_0 = ... | ||
445 | local _idx_0 = 1 | ||
446 | for _key_0, _value_0 in pairs(_obj_0) do | ||
447 | if _idx_0 == _key_0 then | ||
448 | _tab_0[#_tab_0 + 1] = _value_0 | ||
449 | _idx_0 = _idx_0 + 1 | ||
450 | else | ||
451 | _tab_0[_key_0] = _value_0 | ||
452 | end | ||
453 | end | ||
454 | local _obj_1 = { | ||
455 | ... | ||
456 | } | ||
457 | local _idx_1 = 1 | ||
458 | for _key_0, _value_0 in pairs(_obj_1) do | ||
459 | if _idx_1 == _key_0 then | ||
460 | _tab_0[#_tab_0 + 1] = _value_0 | ||
461 | _idx_1 = _idx_1 + 1 | ||
462 | else | ||
463 | _tab_0[_key_0] = _value_0 | ||
464 | end | ||
465 | end | ||
466 | local _obj_2 | ||
467 | do | ||
468 | local _tab_1 = { } | ||
469 | local _obj_3 = ... | ||
470 | local _idx_2 = 1 | ||
471 | for _key_0, _value_0 in pairs(_obj_3) do | ||
472 | if _idx_2 == _key_0 then | ||
473 | _tab_1[#_tab_1 + 1] = _value_0 | ||
474 | _idx_2 = _idx_2 + 1 | ||
475 | else | ||
476 | _tab_1[_key_0] = _value_0 | ||
477 | end | ||
478 | end | ||
479 | _obj_2 = _tab_1 | ||
480 | end | ||
481 | local _idx_2 = 1 | ||
482 | for _key_0, _value_0 in pairs(_obj_2) do | ||
483 | if _idx_2 == _key_0 then | ||
484 | _tab_0[#_tab_0 + 1] = _value_0 | ||
485 | _idx_2 = _idx_2 + 1 | ||
486 | else | ||
487 | _tab_0[_key_0] = _value_0 | ||
488 | end | ||
489 | end | ||
490 | _tab_0[#_tab_0 + 1] = 1 | ||
491 | _tab_0[#_tab_0 + 1] = 2 | ||
492 | _tab_0[#_tab_0 + 1] = 3 | ||
493 | tb_u6df7_u5408B = _tab_0 | ||
494 | end | ||
495 | local _u6a21_u677f <const> = { | ||
496 | foo = "你好", | ||
497 | bar = "世界", | ||
498 | baz = "!" | ||
499 | } | ||
500 | local _u4e13_u95e8_u5316 <const> = (function() | ||
501 | local _tab_0 = { } | ||
502 | local _idx_0 = 1 | ||
503 | for _key_0, _value_0 in pairs(_u6a21_u677f) do | ||
504 | if _idx_0 == _key_0 then | ||
505 | _tab_0[#_tab_0 + 1] = _value_0 | ||
506 | _idx_0 = _idx_0 + 1 | ||
507 | else | ||
508 | _tab_0[_key_0] = _value_0 | ||
509 | end | ||
510 | end | ||
511 | _tab_0.bar = "鲍勃" | ||
512 | return _tab_0 | ||
513 | end)() | ||
514 | local _u4e13_u95e8_u5316B | ||
515 | do | ||
516 | local _tab_0 = { | ||
517 | ["函数"] = function() end | ||
518 | } | ||
519 | local _idx_0 = 1 | ||
520 | for _key_0, _value_0 in pairs(_u6a21_u677f) do | ||
521 | if _idx_0 == _key_0 then | ||
522 | _tab_0[#_tab_0 + 1] = _value_0 | ||
523 | _idx_0 = _idx_0 + 1 | ||
524 | else | ||
525 | _tab_0[_key_0] = _value_0 | ||
526 | end | ||
527 | end | ||
528 | _tab_0["结束"] = function() end | ||
529 | _tab_0["如果"] = true | ||
530 | _tab_0["否则"] = false | ||
531 | _u4e13_u95e8_u5316B = _tab_0 | ||
532 | end | ||
533 | local _u90e8_u5206 = { | ||
534 | "肩膀", | ||
535 | "膝盖" | ||
536 | } | ||
537 | local _u6b4c_u8bcd | ||
538 | do | ||
539 | local _tab_0 = { | ||
540 | "头" | ||
541 | } | ||
542 | local _idx_0 = 1 | ||
543 | for _key_0, _value_0 in pairs(_u90e8_u5206) do | ||
544 | if _idx_0 == _key_0 then | ||
545 | _tab_0[#_tab_0 + 1] = _value_0 | ||
546 | _idx_0 = _idx_0 + 1 | ||
547 | else | ||
548 | _tab_0[_key_0] = _value_0 | ||
549 | end | ||
550 | end | ||
551 | _tab_0[#_tab_0 + 1] = "和" | ||
552 | _tab_0[#_tab_0 + 1] = "脚趾" | ||
553 | _u6b4c_u8bcd = _tab_0 | ||
554 | end | ||
555 | local tb_u5757 = { | ||
556 | ["子菜单"] = (function(...) | ||
557 | local _tab_0 = { | ||
558 | ["值"] = _u503c | ||
559 | } | ||
560 | local _idx_0 = 1 | ||
561 | for _key_0, _value_0 in pairs(_u7269_u54c1) do | ||
562 | if _idx_0 == _key_0 then | ||
563 | _tab_0[#_tab_0 + 1] = _value_0 | ||
564 | _idx_0 = _idx_0 + 1 | ||
565 | else | ||
566 | _tab_0[_key_0] = _value_0 | ||
567 | end | ||
568 | end | ||
569 | for _index_0 = 1, select('#', ...) do | ||
570 | _tab_0[#_tab_0 + 1] = select(_index_0, ...) | ||
571 | end | ||
572 | return _tab_0 | ||
573 | end)(...) | ||
574 | } | ||
575 | _u51fd_u6570((function(...) | ||
576 | local _tab_0 = { } | ||
577 | local _idx_0 = 1 | ||
578 | for _key_0, _value_0 in pairs(_u7269_u54c1) do | ||
579 | if _idx_0 == _key_0 then | ||
580 | _tab_0[#_tab_0 + 1] = _value_0 | ||
581 | _idx_0 = _idx_0 + 1 | ||
582 | else | ||
583 | _tab_0[_key_0] = _value_0 | ||
584 | end | ||
585 | end | ||
586 | _tab_0["值"] = _u503c | ||
587 | _tab_0[#_tab_0 + 1] = ... | ||
588 | _tab_0.k = _u53d8_u91cfv | ||
589 | for _index_0 = 1, select('#', ...) do | ||
590 | _tab_0[#_tab_0 + 1] = select(_index_0, ...) | ||
591 | end | ||
592 | return _tab_0 | ||
593 | end)(...)) | ||
594 | return nil | ||
diff --git a/spec/outputs/unicode/try_catch.lua b/spec/outputs/unicode/try_catch.lua new file mode 100644 index 0000000..fde63d6 --- /dev/null +++ b/spec/outputs/unicode/try_catch.lua | |||
@@ -0,0 +1,61 @@ | |||
1 | xpcall(_u51fd_u6570, function(_u9519_u8bef) | ||
2 | return _u6253_u5370(_u9519_u8bef) | ||
3 | end, 1, 2, 3) | ||
4 | xpcall(_u51fd_u6570, function(_u9519_u8bef) | ||
5 | return _u6253_u5370(_u9519_u8bef) | ||
6 | end, 1, 2, 3) | ||
7 | pcall(function() | ||
8 | _u6253_u5370("正在try") | ||
9 | return _u51fd_u6570(1, 2, 3) | ||
10 | end) | ||
11 | do | ||
12 | local _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef) | ||
13 | return _u6253_u5370(_u9519_u8bef) | ||
14 | end, 1, 2, 3) | ||
15 | _u6210_u529f, _u7ed3_u679c = pcall(_u51fd_u6570, 1, 2, 3) | ||
16 | end | ||
17 | pcall(_u8868["函数"]) | ||
18 | pcall(_u8868["函数"]) | ||
19 | pcall(_u8868["函数"]) | ||
20 | pcall((_u8868["函数"])) | ||
21 | pcall(((function() | ||
22 | local _base_0 = _u8868 | ||
23 | local _fn_0 = _base_0["函数"] | ||
24 | return _fn_0 and function(...) | ||
25 | return _fn_0(_base_0, ...) | ||
26 | end | ||
27 | end)()), 1, 2, 3) | ||
28 | pcall(_u8868["函数"], 1) | ||
29 | pcall(_u8868["函数"], 1) | ||
30 | if (xpcall(_u51fd_u6570, function(_u9519_u8bef) | ||
31 | return _u6253_u5370(_u9519_u8bef) | ||
32 | end, 1)) then | ||
33 | _u6253_u5370("好的") | ||
34 | end | ||
35 | if xpcall((_u51fd_u6570), function(_u9519_u8bef) | ||
36 | return _u6253_u5370(_u9519_u8bef) | ||
37 | end, 1) then | ||
38 | _u6253_u5370("好的") | ||
39 | end | ||
40 | do | ||
41 | do | ||
42 | local _u6210_u529f, _u7ed3_u679c = pcall(_u51fd_u6570, "abc", 123) | ||
43 | if _u6210_u529f then | ||
44 | _u6253_u5370(_u7ed3_u679c) | ||
45 | end | ||
46 | end | ||
47 | local _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef) | ||
48 | return _u6253_u5370(_u9519_u8bef) | ||
49 | end, "abc", 123) | ||
50 | _u6210_u529f, _u7ed3_u679c = xpcall(_u51fd_u6570, function(_u9519_u8bef) | ||
51 | return _u6253_u5370(_u9519_u8bef) | ||
52 | end, "abc", 123) | ||
53 | if _u6210_u529f then | ||
54 | _u6253_u5370(_u7ed3_u679c) | ||
55 | end | ||
56 | end | ||
57 | do | ||
58 | pcall(_u51fd_u6570, 1, 2, 3) | ||
59 | pcall(_u51fd_u6570, 1, 2, 3) | ||
60 | end | ||
61 | return nil | ||
diff --git a/spec/outputs/unicode/unless_else.lua b/spec/outputs/unicode/unless_else.lua new file mode 100644 index 0000000..38b2e63 --- /dev/null +++ b/spec/outputs/unicode/unless_else.lua | |||
@@ -0,0 +1,7 @@ | |||
1 | if _u53d8_u91cfa then | ||
2 | if not _u53d8_u91cfb then | ||
3 | return _u6253_u5370("嗨") | ||
4 | elseif _u53d8_u91cfc then | ||
5 | return _u6253_u5370("不嗨") | ||
6 | end | ||
7 | end | ||
diff --git a/spec/outputs/unicode/using.lua b/spec/outputs/unicode/using.lua new file mode 100644 index 0000000..8b6bd1c --- /dev/null +++ b/spec/outputs/unicode/using.lua | |||
@@ -0,0 +1,30 @@ | |||
1 | local _u4f60_u597d = "你好" | ||
2 | local _u4e16_u754c = "世界" | ||
3 | local _ | ||
4 | _ = function() | ||
5 | local _u4f60_u597d = 3223 | ||
6 | end | ||
7 | _ = function(_u53c2_u6570a) | ||
8 | local _u4f60_u597d = 3223 | ||
9 | _u53c2_u6570a = 323 | ||
10 | end | ||
11 | _ = function(_u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c) | ||
12 | _u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c = 1, 2, 3 | ||
13 | local _u4e16_u754c = 12321 | ||
14 | end | ||
15 | _ = function(_u53c2_u6570a, _u53c2_u6570e, _u53c2_u6570f) | ||
16 | local _u53c2_u6570b, _u53c2_u6570c | ||
17 | _u53c2_u6570a, _u53c2_u6570b, _u53c2_u6570c = 1, 2, 3 | ||
18 | local _u4f60_u597d = 12321 | ||
19 | local _u4e16_u754c = "yeah" | ||
20 | end | ||
21 | _ = function() | ||
22 | local _u4f60_u597d = _u4f60_u597d or 2 | ||
23 | end | ||
24 | do | ||
25 | local _u53d8_u91cfa = { } | ||
26 | _(function() | ||
27 | local _u5143_u7d20x, _u5143_u7d20y = _u53d8_u91cfa[1], _u53d8_u91cfa[2] | ||
28 | end) | ||
29 | end | ||
30 | return nil | ||
diff --git a/spec/outputs/unicode/vararg.lua b/spec/outputs/unicode/vararg.lua new file mode 100644 index 0000000..782bf22 --- /dev/null +++ b/spec/outputs/unicode/vararg.lua | |||
@@ -0,0 +1,301 @@ | |||
1 | local _u8fde_u63a5 | ||
2 | _u8fde_u63a5 = function(...) | ||
3 | _u5e26_u6709((function() | ||
4 | local _with_0 = _u53d8_u91cfa | ||
5 | _with_0["函数"](_with_0) | ||
6 | return _with_0 | ||
7 | end)()) | ||
8 | _u5e26_u6709((function(...) | ||
9 | local _with_0 = _u53d8_u91cfa | ||
10 | _with_0["函数"](_with_0, ...) | ||
11 | return _with_0 | ||
12 | end)(...)) | ||
13 | _u5217_u8868_u751f_u6210((function() | ||
14 | local _accum_0 = { } | ||
15 | local _len_0 = 1 | ||
16 | for i = 1, 10 do | ||
17 | _accum_0[_len_0] = _u9879_u76ee[i] | ||
18 | _len_0 = _len_0 + 1 | ||
19 | end | ||
20 | return _accum_0 | ||
21 | end)()) | ||
22 | _u5217_u8868_u751f_u6210((function(...) | ||
23 | local _accum_0 = { } | ||
24 | local _len_0 = 1 | ||
25 | for i = 1, 10 do | ||
26 | _accum_0[_len_0] = _u9879_u76ee[i](...) | ||
27 | _len_0 = _len_0 + 1 | ||
28 | end | ||
29 | return _accum_0 | ||
30 | end)(...)) | ||
31 | _u5217_u8868_u751f_u6210((function() | ||
32 | local _accum_0 = { } | ||
33 | local _len_0 = 1 | ||
34 | local _list_0 = _u9879_u76ee | ||
35 | for _index_0 = 1, #_list_0 do | ||
36 | local _u7269_u54c1 = _list_0[_index_0] | ||
37 | _accum_0[_len_0] = _u7269_u54c1 | ||
38 | _len_0 = _len_0 + 1 | ||
39 | end | ||
40 | return _accum_0 | ||
41 | end)()) | ||
42 | _u5217_u8868_u751f_u6210((function(...) | ||
43 | local _accum_0 = { } | ||
44 | local _len_0 = 1 | ||
45 | local _list_0 = _u9879_u76ee | ||
46 | for _index_0 = 1, #_list_0 do | ||
47 | local _u7269_u54c1 = _list_0[_index_0] | ||
48 | _accum_0[_len_0] = _u7269_u54c1(...) | ||
49 | _len_0 = _len_0 + 1 | ||
50 | end | ||
51 | return _accum_0 | ||
52 | end)(...)) | ||
53 | _u7c7b_u751f_u6210((function() | ||
54 | local _u53d8_u91cfA | ||
55 | do | ||
56 | local _class_0 | ||
57 | local _base_0 = { } | ||
58 | if _base_0.__index == nil then | ||
59 | _base_0.__index = _base_0 | ||
60 | end | ||
61 | _class_0 = setmetatable({ | ||
62 | __init = function() end, | ||
63 | __base = _base_0, | ||
64 | __name = "变量A" | ||
65 | }, { | ||
66 | __index = _base_0, | ||
67 | __call = function(cls, ...) | ||
68 | local _self_0 = setmetatable({ }, _base_0) | ||
69 | cls.__init(_self_0, ...) | ||
70 | return _self_0 | ||
71 | end | ||
72 | }) | ||
73 | _base_0.__class = _class_0 | ||
74 | local self = _class_0; | ||
75 | _u51fd_u6570() | ||
76 | _u53d8_u91cfA = _class_0 | ||
77 | return _class_0 | ||
78 | end | ||
79 | end)()) | ||
80 | _u7c7b_u751f_u6210((function(...) | ||
81 | local _u53d8_u91cfA | ||
82 | do | ||
83 | local _class_0 | ||
84 | local _base_0 = { } | ||
85 | if _base_0.__index == nil then | ||
86 | _base_0.__index = _base_0 | ||
87 | end | ||
88 | _class_0 = setmetatable({ | ||
89 | __init = function() end, | ||
90 | __base = _base_0, | ||
91 | __name = "变量A" | ||
92 | }, { | ||
93 | __index = _base_0, | ||
94 | __call = function(cls, ...) | ||
95 | local _self_0 = setmetatable({ }, _base_0) | ||
96 | cls.__init(_self_0, ...) | ||
97 | return _self_0 | ||
98 | end | ||
99 | }) | ||
100 | _base_0.__class = _class_0 | ||
101 | local self = _class_0; | ||
102 | _u51fd_u6570(...) | ||
103 | _u53d8_u91cfA = _class_0 | ||
104 | return _class_0 | ||
105 | end | ||
106 | end)(...)) | ||
107 | _u8868_u751f_u6210((function() | ||
108 | local _tbl_0 = { } | ||
109 | for _u952e, _u503c in pairs(_u8868) do | ||
110 | _tbl_0[_u952e] = _u503c | ||
111 | end | ||
112 | return _tbl_0 | ||
113 | end)()) | ||
114 | _u8868_u751f_u6210((function(...) | ||
115 | local _tbl_0 = { } | ||
116 | for _u952e, _u503c in pairs(_u8868) do | ||
117 | _tbl_0[_u952e] = _u503c(...) | ||
118 | end | ||
119 | return _tbl_0 | ||
120 | end)(...)) | ||
121 | _u8868_u751f_u6210((function() | ||
122 | local _tbl_0 = { } | ||
123 | local _list_0 = _u9879_u76ee | ||
124 | for _index_0 = 1, #_list_0 do | ||
125 | local _u7269_u54c1 = _list_0[_index_0] | ||
126 | _tbl_0[_u7269_u54c1] = true | ||
127 | end | ||
128 | return _tbl_0 | ||
129 | end)()) | ||
130 | _u8868_u751f_u6210((function(...) | ||
131 | local _tbl_0 = { } | ||
132 | local _list_0 = _u9879_u76ee | ||
133 | for _index_0 = 1, #_list_0 do | ||
134 | local _u7269_u54c1 = _list_0[_index_0] | ||
135 | _tbl_0[_u7269_u54c1(...)] = true | ||
136 | end | ||
137 | return _tbl_0 | ||
138 | end)(...)) | ||
139 | _u505a_u64cd_u4f5c((function() | ||
140 | return _u51fd_u6570() | ||
141 | end)()) | ||
142 | _u505a_u64cd_u4f5c((function(...) | ||
143 | return _u51fd_u6570(...) | ||
144 | end)(...)) | ||
145 | _u5f53_u64cd_u4f5c((function() | ||
146 | local _accum_0 = { } | ||
147 | local _len_0 = 1 | ||
148 | while false do | ||
149 | _accum_0[_len_0] = _u51fd_u6570() | ||
150 | _len_0 = _len_0 + 1 | ||
151 | end | ||
152 | return _accum_0 | ||
153 | end)()) | ||
154 | _u5f53_u64cd_u4f5c((function(...) | ||
155 | local _accum_0 = { } | ||
156 | local _len_0 = 1 | ||
157 | while false do | ||
158 | _accum_0[_len_0] = _u51fd_u6570(...) | ||
159 | _len_0 = _len_0 + 1 | ||
160 | end | ||
161 | return _accum_0 | ||
162 | end)(...)) | ||
163 | _u5982_u679c_u64cd_u4f5c((function() | ||
164 | if false then | ||
165 | return _u51fd_u6570() | ||
166 | end | ||
167 | end)()) | ||
168 | _u5982_u679c_u64cd_u4f5c((function(...) | ||
169 | if false then | ||
170 | return _u51fd_u6570(...) | ||
171 | end | ||
172 | end)(...)) | ||
173 | _u9664_u975e_u64cd_u4f5c((function() | ||
174 | if not true then | ||
175 | return _u51fd_u6570() | ||
176 | end | ||
177 | end)()) | ||
178 | _u9664_u975e_u64cd_u4f5c((function(...) | ||
179 | if not true then | ||
180 | return _u51fd_u6570(...) | ||
181 | end | ||
182 | end)(...)) | ||
183 | _u5207_u6362_u64cd_u4f5c((function() | ||
184 | local _exp_0 = _u53d8_u91cfx | ||
185 | if "abc" == _exp_0 then | ||
186 | return _u51fd_u6570() | ||
187 | end | ||
188 | end)()) | ||
189 | _u5207_u6362_u64cd_u4f5c((function(...) | ||
190 | local _exp_0 = _u53d8_u91cfx | ||
191 | if "abc" == _exp_0 then | ||
192 | return _u51fd_u6570(...) | ||
193 | end | ||
194 | end)(...)) | ||
195 | _u8868_u8fbe_u5f0f_u64cd_u4f5c((function() | ||
196 | local _obj_0 = _u51fd_u6570 | ||
197 | if _obj_0 ~= nil then | ||
198 | return _obj_0() | ||
199 | end | ||
200 | return nil | ||
201 | end)()) | ||
202 | _u8868_u8fbe_u5f0f_u64cd_u4f5c((function(...) | ||
203 | local _obj_0 = _u51fd_u6570 | ||
204 | if _obj_0 ~= nil then | ||
205 | return _obj_0(...) | ||
206 | end | ||
207 | return nil | ||
208 | end)(...)) | ||
209 | _u5192_u53f7((function() | ||
210 | local _base_0 = f() | ||
211 | local _fn_0 = _base_0["函数"] | ||
212 | return _fn_0 and function(...) | ||
213 | return _fn_0(_base_0, ...) | ||
214 | end | ||
215 | end)()) | ||
216 | _u5192_u53f7((function(...) | ||
217 | local _base_0 = f(...) | ||
218 | local _fn_0 = _base_0["函数"] | ||
219 | return _fn_0 and function(...) | ||
220 | return _fn_0(_base_0, ...) | ||
221 | end | ||
222 | end)(...)) | ||
223 | local _ | ||
224 | _ = function() | ||
225 | local _u5217_u8868 = { | ||
226 | 1, | ||
227 | 2, | ||
228 | 3, | ||
229 | 4, | ||
230 | 5 | ||
231 | } | ||
232 | local _u51fd_u6570_u540d | ||
233 | _u51fd_u6570_u540d = function(_u786e_u5b9a) | ||
234 | return _u786e_u5b9a, table.unpack(_u5217_u8868) | ||
235 | end | ||
236 | return (function(_arg_0, ...) | ||
237 | local _u786e_u5b9a = _arg_0 | ||
238 | _u6253_u5370(_u786e_u5b9a, ...) | ||
239 | local _u591a_u53c2_u6570_u51fd_u6570 | ||
240 | _u591a_u53c2_u6570_u51fd_u6570 = function() | ||
241 | return 10, nil, 20, nil, 30 | ||
242 | end | ||
243 | return (function(...) | ||
244 | _u6253_u5370(select("#", ...)) | ||
245 | return _u6253_u5370(...) | ||
246 | end)(_u591a_u53c2_u6570_u51fd_u6570()) | ||
247 | end)(_u51fd_u6570_u540d(true)) | ||
248 | end | ||
249 | do | ||
250 | (function(...) | ||
251 | return _u6253_u5370(...) | ||
252 | end)((function() | ||
253 | if true then | ||
254 | return 1, 2 | ||
255 | end | ||
256 | end)()) | ||
257 | end | ||
258 | do | ||
259 | (function(_arg_0, ...) | ||
260 | local _u53d8_u91cfa = _arg_0 | ||
261 | return _u6253_u5370(_u53d8_u91cfa, select('#', ...)) | ||
262 | end)((function() | ||
263 | if not true then | ||
264 | return 1, 2 | ||
265 | end | ||
266 | end)()) | ||
267 | end | ||
268 | do | ||
269 | (function(...) | ||
270 | return _u6253_u5370(...) | ||
271 | end)((function() | ||
272 | local _exp_0 = _u53d8_u91cfx | ||
273 | if 1 == _exp_0 then | ||
274 | local _with_0 = _u8868 | ||
275 | _with_0["变量x"] = 123 | ||
276 | return _with_0 | ||
277 | else | ||
278 | return _u88682 | ||
279 | end | ||
280 | end)()) | ||
281 | end | ||
282 | do | ||
283 | (function(...) | ||
284 | return _u6253_u5370(...) | ||
285 | end)(1, 2, (function() | ||
286 | if _u6761_u4ef6 then | ||
287 | return 3, 4, 5 | ||
288 | end | ||
289 | end)()) | ||
290 | end | ||
291 | do | ||
292 | (function(_arg_0, ...) | ||
293 | local _u8868 = _arg_0 | ||
294 | return _u6253_u5370(...) | ||
295 | end)({ | ||
296 | ["名字"] = "abc", | ||
297 | ["值"] = 123 | ||
298 | }) | ||
299 | end | ||
300 | return nil | ||
301 | end | ||
diff --git a/spec/outputs/unicode/whitespace.lua b/spec/outputs/unicode/whitespace.lua new file mode 100644 index 0000000..d026abb --- /dev/null +++ b/spec/outputs/unicode/whitespace.lua | |||
@@ -0,0 +1,98 @@ | |||
1 | local _ = { | ||
2 | 1, | ||
3 | 2 | ||
4 | } | ||
5 | _ = { | ||
6 | 1, | ||
7 | 2 | ||
8 | } | ||
9 | _ = { | ||
10 | 1, | ||
11 | 2 | ||
12 | } | ||
13 | _ = { | ||
14 | 1, | ||
15 | 2 | ||
16 | } | ||
17 | _ = { | ||
18 | 1, | ||
19 | 2 | ||
20 | } | ||
21 | _ = { | ||
22 | _u4e8b_u60c5(1, 2, 4, 5, 6), | ||
23 | 3, | ||
24 | 4, | ||
25 | 5 | ||
26 | } | ||
27 | _ = { | ||
28 | _u53d8_u91cfa(1, 2, 3), | ||
29 | 4, | ||
30 | 5, | ||
31 | 6, | ||
32 | 1, | ||
33 | 2, | ||
34 | 3 | ||
35 | } | ||
36 | _ = { | ||
37 | _u53d8_u91cfb(1, 2, 3, 4, 5, 6), | ||
38 | 1, | ||
39 | 2, | ||
40 | 3, | ||
41 | 1, | ||
42 | 2, | ||
43 | 3 | ||
44 | } | ||
45 | _ = { | ||
46 | 1, | ||
47 | 2, | ||
48 | 3 | ||
49 | } | ||
50 | _ = { | ||
51 | _u53d8_u91cfc(1, 2, 3) | ||
52 | } | ||
53 | _u4f60_u597d(1, 2, 3, 4, 1, 2, 3, 4, 4, 5) | ||
54 | _u53d8_u91cfx(1, 2, 3, 4, 5, 6) | ||
55 | _u4f60_u597d(1, 2, 3, _u4e16_u754c(4, 5, 6, 5, 6, 7, 8)) | ||
56 | _u4f60_u597d(1, 2, 3, _u4e16_u754c(4, 5, 6, 5, 6, 7, 8), 9, 9) | ||
57 | _ = { | ||
58 | _u4f60_u597d(1, 2), | ||
59 | 3, | ||
60 | 4, | ||
61 | 5, | ||
62 | 6 | ||
63 | } | ||
64 | local _u53d8_u91cfx = { | ||
65 | _u4f60_u597d(1, 2, 3, 4, 5, 6, 7), | ||
66 | 1, | ||
67 | 2, | ||
68 | 3, | ||
69 | 4 | ||
70 | } | ||
71 | if _u4f60_u597d(1, 2, 3, _u4e16_u754c, _u4e16_u754c) then | ||
72 | _u6253_u5370("你好") | ||
73 | end | ||
74 | if _u4f60_u597d(1, 2, 3, _u4e16_u754c, _u4e16_u754c) then | ||
75 | _u6253_u5370("你好") | ||
76 | end | ||
77 | _u53d8_u91cfa(_u4e00_u4e2a, _u4e24_u4e2a, _u4e09_u4e2a) | ||
78 | _u53d8_u91cfb(_u4e00_u4e2a, _u4e24_u4e2a, _u4e09_u4e2a) | ||
79 | _u53d8_u91cfc(_u4e00_u4e2a, _u4e24_u4e2a, _u4e09_u4e2a, _u56db_u4e2a) | ||
80 | local v | ||
81 | v = function() | ||
82 | return _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc | ||
83 | end | ||
84 | local v1, v2, v3 | ||
85 | v1, v2, v3 = function() | ||
86 | return _u53d8_u91cfa | ||
87 | end, _u53d8_u91cfb, _u53d8_u91cfc | ||
88 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc, _u53d8_u91cfd, _u53d8_u91cfe, _u53d8_u91cff = 1, f2({ | ||
89 | abc = abc | ||
90 | }), 3, 4, _u51fd_u65705(abc), 6 | ||
91 | for _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc in pairs(_u5bf9_u8c61tb) do | ||
92 | _u6253_u5370(_u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc) | ||
93 | end | ||
94 | for i = 1, 10, -1 do | ||
95 | _u6253_u5370(i) | ||
96 | end | ||
97 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc | ||
98 | return nil | ||
diff --git a/spec/outputs/unicode/with.lua b/spec/outputs/unicode/with.lua new file mode 100644 index 0000000..0dcd4a7 --- /dev/null +++ b/spec/outputs/unicode/with.lua | |||
@@ -0,0 +1,222 @@ | |||
1 | do | ||
2 | local _u53d8_u91cfa | ||
3 | _u53d8_u91cfa = function() | ||
4 | local _with_0 = _u4e1c_u897f | ||
5 | _u6253_u5370(_with_0["你好"]) | ||
6 | _u6253_u5370(_u4f60_u597d) | ||
7 | _u6253_u5370("世界") | ||
8 | return _with_0 | ||
9 | end | ||
10 | end | ||
11 | do | ||
12 | do | ||
13 | local _with_0 = _u53f6_u5b50 | ||
14 | _with_0["世界"]() | ||
15 | _with_0["世界"](1, 2, 3) | ||
16 | local _u53d8_u91cfg = _with_0["什么"]["是"]["这"] | ||
17 | _with_0["你好"](1, 2, 3) | ||
18 | _with_0["你好"](_with_0, 1, 2)["世界"](2323) | ||
19 | _with_0["你好"](_with_0, "是的", "伙计") | ||
20 | _with_0["世界"] = 200 | ||
21 | end | ||
22 | end | ||
23 | do | ||
24 | local _u6ecb_u6ecb_u6ecb | ||
25 | do | ||
26 | local _with_0 = _u4e1c_u897f | ||
27 | _with_0["设置状态"]("你好 世界") | ||
28 | _u6ecb_u6ecb_u6ecb = _with_0 | ||
29 | end | ||
30 | end | ||
31 | do | ||
32 | local _u53d8_u91cfx = 5 + (function() | ||
33 | local _with_0 = _u67d0_u4e8b() | ||
34 | _with_0["写"](_with_0, "你好 世界") | ||
35 | return _with_0 | ||
36 | end)() | ||
37 | end | ||
38 | do | ||
39 | local _u53d8_u91cfx = { | ||
40 | ["你好"] = (function() | ||
41 | local _with_0 = _u597d_u7684 | ||
42 | _with_0["确定"](_with_0) | ||
43 | return _with_0 | ||
44 | end)() | ||
45 | } | ||
46 | end | ||
47 | do | ||
48 | do | ||
49 | local _with_0 = _u4e1c_u897f | ||
50 | local _ = _with_0["属性"](_with_0, "某物")["你好"] | ||
51 | local _call_0 = _with_0["属性"] | ||
52 | _call_0["发送"](_call_0, _u4e00_u4e2a) | ||
53 | local _call_1 = _with_0["属性"] | ||
54 | _call_1["发送"](_call_1, _u4e00_u4e2a) | ||
55 | end | ||
56 | end | ||
57 | do | ||
58 | do | ||
59 | local _with_0 = _u53d8_u91cfa | ||
60 | _u6253_u5370(_with_0["世界"]) | ||
61 | end | ||
62 | local _u6a21_u5757 | ||
63 | do | ||
64 | local __u6a21_u5757 = { } | ||
65 | __u6a21_u5757["事物"] = "你好" | ||
66 | _u6a21_u5757 = __u6a21_u5757 | ||
67 | end | ||
68 | do | ||
69 | local _u53d8_u91cfa, _u53d8_u91cfb = _u4e1c_u897f, _u5e03 | ||
70 | _u6253_u5370(_u53d8_u91cfa["世界"]) | ||
71 | end | ||
72 | local _u53d8_u91cfx | ||
73 | do | ||
74 | local _u53d8_u91cfa, _u53d8_u91cfb = 1, 2 | ||
75 | _u6253_u5370(_u53d8_u91cfa + _u53d8_u91cfb) | ||
76 | _u53d8_u91cfx = _u53d8_u91cfa | ||
77 | end | ||
78 | _u6253_u5370((function() | ||
79 | local _u53d8_u91cfa, _u53d8_u91cfb = 1, 2 | ||
80 | _u6253_u5370(_u53d8_u91cfa + _u53d8_u91cfb) | ||
81 | return _u53d8_u91cfa | ||
82 | end)()) | ||
83 | local p | ||
84 | do | ||
85 | local _with_0 = 1 | ||
86 | _u4f60_u597d()["字段x"], _u4e16_u754c()["字段y"] = _with_0, 2 | ||
87 | _u6253_u5370(_u53d8_u91cfa + _u53d8_u91cfb) | ||
88 | p = _with_0 | ||
89 | end | ||
90 | end | ||
91 | do | ||
92 | local _u53d8_u91cfx = "你好" | ||
93 | _u53d8_u91cfx["大写"](_u53d8_u91cfx) | ||
94 | end | ||
95 | do | ||
96 | do | ||
97 | local _u53d8_u91cfk = "乔" | ||
98 | _u6253_u5370(_u53d8_u91cfk["大写"](_u53d8_u91cfk)) | ||
99 | end | ||
100 | end | ||
101 | do | ||
102 | do | ||
103 | local _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = "", "", "" | ||
104 | _u6253_u5370(_u53d8_u91cfa["大写"](_u53d8_u91cfa)) | ||
105 | end | ||
106 | end | ||
107 | do | ||
108 | local _u53d8_u91cfa = "床铺" | ||
109 | do | ||
110 | local _u53d8_u91cfb, _u53d8_u91cfc | ||
111 | _u53d8_u91cfa, _u53d8_u91cfb, _u53d8_u91cfc = "", "", "" | ||
112 | _u6253_u5370(_u53d8_u91cfa["大写"](_u53d8_u91cfa)) | ||
113 | end | ||
114 | end | ||
115 | do | ||
116 | do | ||
117 | local _with_0 = _u53d8_u91cfj | ||
118 | _u6253_u5370(_with_0["大写"](_with_0)) | ||
119 | end | ||
120 | end | ||
121 | do | ||
122 | do | ||
123 | local _with_0 = "乔" | ||
124 | _u53d8_u91cfk["变量j"] = _with_0 | ||
125 | _u6253_u5370(_with_0["大写"](_with_0)) | ||
126 | end | ||
127 | end | ||
128 | do | ||
129 | do | ||
130 | local _with_0 = _u53d8_u91cfa | ||
131 | _u6253_u5370(_with_0.b) | ||
132 | do | ||
133 | local _with_1 = _with_0.c | ||
134 | _u6253_u5370(_with_1.d) | ||
135 | end | ||
136 | end | ||
137 | end | ||
138 | do | ||
139 | do | ||
140 | local _with_0 = _u53d8_u91cfa | ||
141 | do | ||
142 | local _with_1 = 2 | ||
143 | _with_0.b = _with_1 | ||
144 | _u6253_u5370(_with_1.c) | ||
145 | end | ||
146 | end | ||
147 | end | ||
148 | do | ||
149 | local _ | ||
150 | _ = function() | ||
151 | local _with_0 = _u55e8 | ||
152 | return _with_0.a, _with_0.b | ||
153 | end | ||
154 | end | ||
155 | do | ||
156 | do | ||
157 | local _with_0 = _u8868_u683c | ||
158 | local _call_0 = _u9879_u76ee["字段"] | ||
159 | _with_0.x = _call_0["函数"](_call_0, 123) | ||
160 | end | ||
161 | end | ||
162 | do | ||
163 | do | ||
164 | local _with_0 = _u7238_u7238 | ||
165 | _with_0["如果"]("是的") | ||
166 | local _u53d8_u91cfy = _with_0["结束"]["函数"] | ||
167 | end | ||
168 | end | ||
169 | do | ||
170 | do | ||
171 | local _with_0 = _u8868_u683c | ||
172 | do | ||
173 | local _obj_0 = _with_0[2] | ||
174 | if _obj_0 ~= nil then | ||
175 | _with_0[1] = _obj_0["函数"](_obj_0) | ||
176 | end | ||
177 | end | ||
178 | _with_0["%a-b-c%"] = 123 | ||
179 | _with_0[ [[x y z]]] = _with_0[_u53d8_u91cf] | ||
180 | _u6253_u5370(_with_0[_with_0[3]]) | ||
181 | do | ||
182 | local _with_1 = _with_0[4] | ||
183 | _with_1[1] = 1 | ||
184 | end | ||
185 | _with_0[#_with_0 + 1] = "abc" | ||
186 | _with_0[#_with_0 + 1] = { | ||
187 | ["类型"] = "你好", | ||
188 | { | ||
189 | ["名字"] = "xyz", | ||
190 | ["值"] = 998 | ||
191 | } | ||
192 | } | ||
193 | end | ||
194 | end | ||
195 | do | ||
196 | do | ||
197 | local _with_0 = _u5b9e_u5fc3_u77e9_u5f62({ | ||
198 | ["宽"] = w, | ||
199 | ["高"] = h, | ||
200 | ["颜色"] = 0x66000000 | ||
201 | }) | ||
202 | _u63a9_u7801 = _with_0 | ||
203 | if _with_0 ~= nil then | ||
204 | _with_0["触摸启用"] = true | ||
205 | _with_0["吞噬触摸"] = true | ||
206 | end | ||
207 | end | ||
208 | end | ||
209 | do | ||
210 | do | ||
211 | local _u63a9_u7801 = _u5b9e_u5fc3_u77e9_u5f62({ | ||
212 | ["宽"] = w, | ||
213 | ["高"] = h, | ||
214 | ["颜色"] = 0x66000000 | ||
215 | }) | ||
216 | if _u63a9_u7801 ~= nil then | ||
217 | _u63a9_u7801["触摸启用"] = true | ||
218 | _u63a9_u7801["吞噬触摸"] = true | ||
219 | end | ||
220 | end | ||
221 | end | ||
222 | return nil | ||