aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/unicode/goto.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-08-17 10:36:15 +0800
committerLi Jin <dragon-fly@qq.com>2023-08-17 10:36:15 +0800
commite61cce21ef7def2c2e52dd6cb6a5b540ebcac29d (patch)
tree6e7c5e7e6f13157e9f8db26c38f6d8cba75683e5 /spec/outputs/unicode/goto.lua
parent289faf45ac26f7e0ac1a1e4305e5c42fc1e5b866 (diff)
downloadyuescript-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/goto.lua')
-rw-r--r--spec/outputs/unicode/goto.lua67
1 files changed, 67 insertions, 0 deletions
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 @@
1do
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::
10end
11do
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::
23end
24do
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
37end
38do
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::
55end
56do
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::
67end