aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/funcs.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-10-12 10:04:44 +0800
committerLi Jin <dragon-fly@qq.com>2021-10-12 10:04:44 +0800
commit60a979e224f26117f5be82bfca757a2483cef0fd (patch)
tree7c6af44f6dcada1f23979b820ba830251997b161 /spec/outputs/funcs.lua
parenta19b242cbaf53721b20a3163dd06f43e9ef2b487 (diff)
downloadyuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.gz
yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.tar.bz2
yuescript-60a979e224f26117f5be82bfca757a2483cef0fd.zip
fix test.
Diffstat (limited to 'spec/outputs/funcs.lua')
-rw-r--r--spec/outputs/funcs.lua222
1 files changed, 222 insertions, 0 deletions
diff --git a/spec/outputs/funcs.lua b/spec/outputs/funcs.lua
new file mode 100644
index 0000000..03281e4
--- /dev/null
+++ b/spec/outputs/funcs.lua
@@ -0,0 +1,222 @@
1local x
2x = function()
3 return print(what)
4end
5local _
6_ = function() end
7_ = function()
8 return function()
9 return function() end
10 end
11end
12go(to(the(barn)))
13open(function()
14 return the(function()
15 return door
16 end)
17end)
18open(function()
19 the(door)
20 local hello
21 hello = function()
22 return my(func)
23 end
24end)
25local h
26h = function()
27 return hi
28end
29eat(function() end, world);
30(function() end)()
31x = function(...) end
32hello()
33hello.world()
34_ = hello().something
35_ = what()["ofefe"]
36what()(the()(heck()))
37_ = function(a, b, c, d, e) end
38_ = function(a, a, a, a, a)
39 return print(a)
40end
41_ = function(x)
42 if x == nil then
43 x = 23023
44 end
45end
46_ = function(x)
47 if x == nil then
48 x = function(y)
49 if y == nil then
50 y = function() end
51 end
52 end
53 end
54end
55_ = function(x)
56 if x == nil then
57 if something then
58 x = yeah
59 else
60 x = no
61 end
62 end
63end
64local something
65something = function(hello, world)
66 if hello == nil then
67 hello = 100
68 end
69 if world == nil then
70 world = function(x)
71 if x == nil then
72 x = [[yeah cool]]
73 end
74 return print("eat rice")
75 end
76 end
77 return print(hello)
78end
79_ = function(self) end
80_ = function(self, x, y) end
81_ = function(self, x, y)
82 self.x = x
83 self.y = y
84end
85_ = function(self, x)
86 if x == nil then
87 x = 1
88 end
89end
90_ = function(self, x, y, z)
91 if x == nil then
92 x = 1
93 end
94 if z == nil then
95 z = "hello world"
96 end
97 self.x = x
98 self.z = z
99end
100x(function()
101 return
102end)
103y(function()
104 return 1
105end)
106z(function()
107 return 1, "hello", "world"
108end)
109k(function()
110 if yes then
111 return
112 else
113 return
114 end
115end)
116_ = function()
117 if something then
118 return real_name
119 end
120end
121d(function()
122 return print("hello world")
123end, 10)
124d(1, 2, 3, 4, 5, 6, (function()
125 if something then
126 print("okay")
127 return 10
128 end
129end)(), 10, 20)
130f()()(what)(function()
131 return print("srue")
132end, 123)
133x = function(a, b)
134 return print("what")
135end
136local y
137y = function(a, b)
138 if a == nil then
139 a = "hi"
140 end
141 if b == nil then
142 b = 23
143 end
144 return print("what")
145end
146local z
147z = function(a, b)
148 if a == nil then
149 a = "hi"
150 end
151 if b == nil then
152 b = 23
153 end
154 return print("what")
155end
156local j
157j = function(f, g, m, a, b)
158 if a == nil then
159 a = "hi"
160 end
161 if b == nil then
162 b = 23
163 end
164 return print("what")
165end
166y = function(a, b, ...)
167 if a == nil then
168 a = "hi"
169 end
170 if b == nil then
171 b = 23
172 end
173 return print("what")
174end
175y = function(a, b, ...)
176 if a == nil then
177 a = "hi"
178 end
179 if b == nil then
180 b = 23
181 end
182 return print("what")
183end
184local args
185args = function(a, b)
186 return print("what")
187end
188args = function(a, b)
189 if a == nil then
190 a = "hi"
191 end
192 if b == nil then
193 b = 23
194 end
195 return print("what")
196end
197args = function(a, b)
198 if a == nil then
199 a = "hi"
200 end
201 if b == nil then
202 b = 23
203 end
204 return print("what")
205end
206args = function(f, g, m, a, b)
207 if a == nil then
208 a = "hi"
209 end
210 if b == nil then
211 b = 23
212 end
213 return print("what")
214end
215local self
216self = function(n)
217 if n == 0 then
218 return 1
219 end
220 return n * self(n - 1)
221end
222return nil