diff options
author | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-10-12 10:04:44 +0800 |
commit | 60a979e224f26117f5be82bfca757a2483cef0fd (patch) | |
tree | 7c6af44f6dcada1f23979b820ba830251997b161 /spec/outputs/return.lua | |
parent | a19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff) | |
download | yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.gz yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.bz2 yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.zip |
fix test.
Diffstat (limited to 'spec/outputs/return.lua')
-rw-r--r-- | spec/outputs/return.lua | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/spec/outputs/return.lua b/spec/outputs/return.lua new file mode 100644 index 0000000..0735b23 --- /dev/null +++ b/spec/outputs/return.lua | |||
@@ -0,0 +1,102 @@ | |||
1 | local _ | ||
2 | _ = function() | ||
3 | local _list_0 = things | ||
4 | for _index_0 = 1, #_list_0 do | ||
5 | local x = _list_0[_index_0] | ||
6 | _ = x | ||
7 | end | ||
8 | end | ||
9 | _ = function() | ||
10 | local _accum_0 = { } | ||
11 | local _len_0 = 1 | ||
12 | local _list_0 = things | ||
13 | for _index_0 = 1, #_list_0 do | ||
14 | local x = _list_0[_index_0] | ||
15 | _accum_0[_len_0] = x | ||
16 | _len_0 = _len_0 + 1 | ||
17 | end | ||
18 | return _accum_0 | ||
19 | end | ||
20 | do | ||
21 | local _list_0 = things | ||
22 | for _index_0 = 1, #_list_0 do | ||
23 | local x = _list_0[_index_0] | ||
24 | return x | ||
25 | end | ||
26 | end | ||
27 | do | ||
28 | local _accum_0 = { } | ||
29 | local _len_0 = 1 | ||
30 | local _list_0 = things | ||
31 | for _index_0 = 1, #_list_0 do | ||
32 | local x = _list_0[_index_0] | ||
33 | _accum_0[_len_0] = x | ||
34 | _len_0 = _len_0 + 1 | ||
35 | end | ||
36 | return _accum_0 | ||
37 | end | ||
38 | do | ||
39 | local _tbl_0 = { } | ||
40 | local _list_0 = things | ||
41 | for _index_0 = 1, #_list_0 do | ||
42 | local x, y = _list_0[_index_0] | ||
43 | _tbl_0[x] = y | ||
44 | end | ||
45 | return _tbl_0 | ||
46 | end | ||
47 | _ = function() | ||
48 | if a then | ||
49 | if a then | ||
50 | return a | ||
51 | else | ||
52 | return b | ||
53 | end | ||
54 | elseif b then | ||
55 | if a then | ||
56 | return a | ||
57 | else | ||
58 | return b | ||
59 | end | ||
60 | else | ||
61 | if a then | ||
62 | return a | ||
63 | else | ||
64 | return b | ||
65 | end | ||
66 | end | ||
67 | end | ||
68 | do | ||
69 | if a then | ||
70 | if a then | ||
71 | return a | ||
72 | else | ||
73 | return b | ||
74 | end | ||
75 | elseif b then | ||
76 | if a then | ||
77 | return a | ||
78 | else | ||
79 | return b | ||
80 | end | ||
81 | else | ||
82 | if a then | ||
83 | return a | ||
84 | else | ||
85 | return b | ||
86 | end | ||
87 | end | ||
88 | end | ||
89 | _ = function() | ||
90 | local _base_0 = a | ||
91 | local _fn_0 = _base_0.b | ||
92 | return _fn_0 and function(...) | ||
93 | return _fn_0(_base_0, ...) | ||
94 | end | ||
95 | end | ||
96 | do | ||
97 | local _base_0 = a | ||
98 | local _fn_0 = _base_0.b | ||
99 | return _fn_0 and function(...) | ||
100 | return _fn_0(_base_0, ...) | ||
101 | end | ||
102 | end | ||