diff options
Diffstat (limited to 'spec/outputs/5.1/attrib.lua')
-rw-r--r-- | spec/outputs/5.1/attrib.lua | 210 |
1 files changed, 179 insertions, 31 deletions
diff --git a/spec/outputs/5.1/attrib.lua b/spec/outputs/5.1/attrib.lua index dc1285c..bda24bc 100644 --- a/spec/outputs/5.1/attrib.lua +++ b/spec/outputs/5.1/attrib.lua | |||
@@ -5,12 +5,36 @@ do | |||
5 | return print("closed") | 5 | return print("closed") |
6 | end | 6 | end |
7 | }) | 7 | }) |
8 | local _close_0 = assert(getmetatable(a).__close) | 8 | local _close_0 |
9 | local _close_1 = assert(getmetatable(b).__close); | 9 | if (function() |
10 | local _val_0 = type(a) | ||
11 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
12 | end)() then | ||
13 | _close_0 = assert(getmetatable(a) and getmetatable(a).__close, "variable 'a' got a non-closable value") | ||
14 | elseif a == nil then | ||
15 | _close_0 = nil | ||
16 | else | ||
17 | _close_0 = error("variable 'a' got a non-closable value") | ||
18 | end | ||
19 | local _close_1 | ||
20 | if (function() | ||
21 | local _val_0 = type(b) | ||
22 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
23 | end)() then | ||
24 | _close_1 = assert(getmetatable(b) and getmetatable(b).__close, "variable 'b' got a non-closable value") | ||
25 | elseif b == nil then | ||
26 | _close_1 = nil | ||
27 | else | ||
28 | _close_1 = error("variable 'b' got a non-closable value") | ||
29 | end | ||
10 | (function(_arg_0, ...) | 30 | (function(_arg_0, ...) |
11 | local _ok_0 = _arg_0 | 31 | local _ok_0 = _arg_0 |
12 | _close_1(b) | 32 | if _close_1 ~= nil then |
13 | _close_0(a) | 33 | _close_1(b) |
34 | end | ||
35 | if _close_0 ~= nil then | ||
36 | _close_0(a) | ||
37 | end | ||
14 | if _ok_0 then | 38 | if _ok_0 then |
15 | return ... | 39 | return ... |
16 | else | 40 | else |
@@ -53,10 +77,22 @@ do | |||
53 | __close = function(self) end | 77 | __close = function(self) end |
54 | }) | 78 | }) |
55 | end | 79 | end |
56 | local _close_0 = assert(getmetatable(v).__close); | 80 | local _close_0 |
81 | if (function() | ||
82 | local _val_0 = type(v) | ||
83 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
84 | end)() then | ||
85 | _close_0 = assert(getmetatable(v) and getmetatable(v).__close, "variable 'v' got a non-closable value") | ||
86 | elseif v == nil then | ||
87 | _close_0 = nil | ||
88 | else | ||
89 | _close_0 = error("variable 'v' got a non-closable value") | ||
90 | end | ||
57 | (function(_arg_0, ...) | 91 | (function(_arg_0, ...) |
58 | local _ok_0 = _arg_0 | 92 | local _ok_0 = _arg_0 |
59 | _close_0(v) | 93 | if _close_0 ~= nil then |
94 | _close_0(v) | ||
95 | end | ||
60 | if _ok_0 then | 96 | if _ok_0 then |
61 | return ... | 97 | return ... |
62 | else | 98 | else |
@@ -69,10 +105,22 @@ do | |||
69 | _with_0:write("Hello") | 105 | _with_0:write("Hello") |
70 | f = _with_0 | 106 | f = _with_0 |
71 | end | 107 | end |
72 | local _close_1 = assert(getmetatable(f).__close) | 108 | local _close_1 |
109 | if (function() | ||
110 | local _val_0 = type(f) | ||
111 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
112 | end)() then | ||
113 | _close_1 = assert(getmetatable(f) and getmetatable(f).__close, "variable 'f' got a non-closable value") | ||
114 | elseif f == nil then | ||
115 | _close_1 = nil | ||
116 | else | ||
117 | _close_1 = error("variable 'f' got a non-closable value") | ||
118 | end | ||
73 | return (function(_arg_0, ...) | 119 | return (function(_arg_0, ...) |
74 | local _ok_0 = _arg_0 | 120 | local _ok_0 = _arg_0 |
75 | _close_1(f) | 121 | if _close_1 ~= nil then |
122 | _close_1(f) | ||
123 | end | ||
76 | if _ok_0 then | 124 | if _ok_0 then |
77 | return ... | 125 | return ... |
78 | else | 126 | else |
@@ -88,14 +136,28 @@ do | |||
88 | end | 136 | end |
89 | local b | 137 | local b |
90 | if not false then | 138 | if not false then |
91 | if x then | 139 | b = ((function() |
92 | b = 1 | 140 | if x then |
93 | end | 141 | return 1 |
142 | end | ||
143 | end)()) | ||
144 | end | ||
145 | local _close_0 | ||
146 | if (function() | ||
147 | local _val_0 = type(b) | ||
148 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
149 | end)() then | ||
150 | _close_0 = assert(getmetatable(b) and getmetatable(b).__close, "variable 'b' got a non-closable value") | ||
151 | elseif b == nil then | ||
152 | _close_0 = nil | ||
153 | else | ||
154 | _close_0 = error("variable 'b' got a non-closable value") | ||
94 | end | 155 | end |
95 | local _close_0 = assert(getmetatable(b).__close); | ||
96 | (function(_arg_0, ...) | 156 | (function(_arg_0, ...) |
97 | local _ok_0 = _arg_0 | 157 | local _ok_0 = _arg_0 |
98 | _close_0(b) | 158 | if _close_0 ~= nil then |
159 | _close_0(b) | ||
160 | end | ||
99 | if _ok_0 then | 161 | if _ok_0 then |
100 | return ... | 162 | return ... |
101 | else | 163 | else |
@@ -104,10 +166,12 @@ do | |||
104 | end)(pcall(function() | 166 | end)(pcall(function() |
105 | local c | 167 | local c |
106 | if true then | 168 | if true then |
107 | local _exp_0 = x | 169 | c = ((function() |
108 | if "abc" == _exp_0 then | 170 | local _exp_0 = x |
109 | c = 998 | 171 | if "abc" == _exp_0 then |
110 | end | 172 | return 998 |
173 | end | ||
174 | end)()) | ||
111 | end | 175 | end |
112 | local d | 176 | local d |
113 | if (function() | 177 | if (function() |
@@ -121,10 +185,22 @@ do | |||
121 | value = value | 185 | value = value |
122 | } | 186 | } |
123 | end | 187 | end |
124 | local _close_1 = assert(getmetatable(d).__close) | 188 | local _close_1 |
189 | if (function() | ||
190 | local _val_0 = type(d) | ||
191 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
192 | end)() then | ||
193 | _close_1 = assert(getmetatable(d) and getmetatable(d).__close, "variable 'd' got a non-closable value") | ||
194 | elseif d == nil then | ||
195 | _close_1 = nil | ||
196 | else | ||
197 | _close_1 = error("variable 'd' got a non-closable value") | ||
198 | end | ||
125 | return (function(_arg_0, ...) | 199 | return (function(_arg_0, ...) |
126 | local _ok_0 = _arg_0 | 200 | local _ok_0 = _arg_0 |
127 | _close_1(d) | 201 | if _close_1 ~= nil then |
202 | _close_1(d) | ||
203 | end | ||
128 | if _ok_0 then | 204 | if _ok_0 then |
129 | return ... | 205 | return ... |
130 | else | 206 | else |
@@ -140,10 +216,22 @@ do | |||
140 | _with_0:write("Hello") | 216 | _with_0:write("Hello") |
141 | _ = _with_0 | 217 | _ = _with_0 |
142 | end | 218 | end |
143 | local _close_0 = assert(getmetatable(_).__close); | 219 | local _close_0 |
220 | if (function() | ||
221 | local _val_0 = type(_) | ||
222 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
223 | end)() then | ||
224 | _close_0 = assert(getmetatable(_) and getmetatable(_).__close, "variable '_' got a non-closable value") | ||
225 | elseif _ == nil then | ||
226 | _close_0 = nil | ||
227 | else | ||
228 | _close_0 = error("variable '_' got a non-closable value") | ||
229 | end | ||
144 | (function(_arg_0, ...) | 230 | (function(_arg_0, ...) |
145 | local _ok_0 = _arg_0 | 231 | local _ok_0 = _arg_0 |
146 | _close_0(_) | 232 | if _close_0 ~= nil then |
233 | _close_0(_) | ||
234 | end | ||
147 | if _ok_0 then | 235 | if _ok_0 then |
148 | return ... | 236 | return ... |
149 | else | 237 | else |
@@ -155,10 +243,22 @@ do | |||
155 | return print("second") | 243 | return print("second") |
156 | end | 244 | end |
157 | }) | 245 | }) |
158 | local _close_1 = assert(getmetatable(_).__close) | 246 | local _close_1 |
247 | if (function() | ||
248 | local _val_0 = type(_) | ||
249 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
250 | end)() then | ||
251 | _close_1 = assert(getmetatable(_) and getmetatable(_).__close, "variable '_' got a non-closable value") | ||
252 | elseif _ == nil then | ||
253 | _close_1 = nil | ||
254 | else | ||
255 | _close_1 = error("variable '_' got a non-closable value") | ||
256 | end | ||
159 | return (function(_arg_0, ...) | 257 | return (function(_arg_0, ...) |
160 | local _ok_0 = _arg_0 | 258 | local _ok_0 = _arg_0 |
161 | _close_1(_) | 259 | if _close_1 ~= nil then |
260 | _close_1(_) | ||
261 | end | ||
162 | if _ok_0 then | 262 | if _ok_0 then |
163 | return ... | 263 | return ... |
164 | else | 264 | else |
@@ -170,10 +270,22 @@ do | |||
170 | return print("first") | 270 | return print("first") |
171 | end | 271 | end |
172 | }) | 272 | }) |
173 | local _close_2 = assert(getmetatable(_).__close) | 273 | local _close_2 |
274 | if (function() | ||
275 | local _val_0 = type(_) | ||
276 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
277 | end)() then | ||
278 | _close_2 = assert(getmetatable(_) and getmetatable(_).__close, "variable '_' got a non-closable value") | ||
279 | elseif _ == nil then | ||
280 | _close_2 = nil | ||
281 | else | ||
282 | _close_2 = error("variable '_' got a non-closable value") | ||
283 | end | ||
174 | return (function(_arg_0, ...) | 284 | return (function(_arg_0, ...) |
175 | local _ok_0 = _arg_0 | 285 | local _ok_0 = _arg_0 |
176 | _close_2(_) | 286 | if _close_2 ~= nil then |
287 | _close_2(_) | ||
288 | end | ||
177 | if _ok_0 then | 289 | if _ok_0 then |
178 | return ... | 290 | return ... |
179 | else | 291 | else |
@@ -200,10 +312,22 @@ do | |||
200 | local _ = def(function() | 312 | local _ = def(function() |
201 | return print(3) | 313 | return print(3) |
202 | end) | 314 | end) |
203 | local _close_0 = assert(getmetatable(_).__close) | 315 | local _close_0 |
316 | if (function() | ||
317 | local _val_0 = type(_) | ||
318 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
319 | end)() then | ||
320 | _close_0 = assert(getmetatable(_) and getmetatable(_).__close, "variable '_' got a non-closable value") | ||
321 | elseif _ == nil then | ||
322 | _close_0 = nil | ||
323 | else | ||
324 | _close_0 = error("variable '_' got a non-closable value") | ||
325 | end | ||
204 | return (function(_arg_0, ...) | 326 | return (function(_arg_0, ...) |
205 | local _ok_0 = _arg_0 | 327 | local _ok_0 = _arg_0 |
206 | _close_0(_) | 328 | if _close_0 ~= nil then |
329 | _close_0(_) | ||
330 | end | ||
207 | if _ok_0 then | 331 | if _ok_0 then |
208 | return ... | 332 | return ... |
209 | else | 333 | else |
@@ -213,10 +337,22 @@ do | |||
213 | local _ = def(function() | 337 | local _ = def(function() |
214 | return print(2) | 338 | return print(2) |
215 | end) | 339 | end) |
216 | local _close_1 = assert(getmetatable(_).__close) | 340 | local _close_1 |
341 | if (function() | ||
342 | local _val_0 = type(_) | ||
343 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
344 | end)() then | ||
345 | _close_1 = assert(getmetatable(_) and getmetatable(_).__close, "variable '_' got a non-closable value") | ||
346 | elseif _ == nil then | ||
347 | _close_1 = nil | ||
348 | else | ||
349 | _close_1 = error("variable '_' got a non-closable value") | ||
350 | end | ||
217 | return (function(_arg_0, ...) | 351 | return (function(_arg_0, ...) |
218 | local _ok_0 = _arg_0 | 352 | local _ok_0 = _arg_0 |
219 | _close_1(_) | 353 | if _close_1 ~= nil then |
354 | _close_1(_) | ||
355 | end | ||
220 | if _ok_0 then | 356 | if _ok_0 then |
221 | return ... | 357 | return ... |
222 | else | 358 | else |
@@ -226,10 +362,22 @@ do | |||
226 | local _ = def(function() | 362 | local _ = def(function() |
227 | return print(1) | 363 | return print(1) |
228 | end) | 364 | end) |
229 | local _close_2 = assert(getmetatable(_).__close) | 365 | local _close_2 |
366 | if (function() | ||
367 | local _val_0 = type(_) | ||
368 | return 'table' == _val_0 or 'userdata' == _val_0 | ||
369 | end)() then | ||
370 | _close_2 = assert(getmetatable(_) and getmetatable(_).__close, "variable '_' got a non-closable value") | ||
371 | elseif _ == nil then | ||
372 | _close_2 = nil | ||
373 | else | ||
374 | _close_2 = error("variable '_' got a non-closable value") | ||
375 | end | ||
230 | return (function(_arg_0, ...) | 376 | return (function(_arg_0, ...) |
231 | local _ok_0 = _arg_0 | 377 | local _ok_0 = _arg_0 |
232 | _close_2(_) | 378 | if _close_2 ~= nil then |
379 | _close_2(_) | ||
380 | end | ||
233 | if _ok_0 then | 381 | if _ok_0 then |
234 | return ... | 382 | return ... |
235 | else | 383 | else |