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/outputs/unicode/loops.lua | |
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/outputs/unicode/loops.lua')
-rw-r--r-- | spec/outputs/unicode/loops.lua | 337 |
1 files changed, 337 insertions, 0 deletions
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 | ||