diff options
Diffstat (limited to 'spec/outputs/5.1')
-rw-r--r-- | spec/outputs/5.1/attrib.lua | 210 | ||||
-rw-r--r-- | spec/outputs/5.1/loops.lua | 132 | ||||
-rw-r--r-- | spec/outputs/5.1/try_catch.lua | 271 |
3 files changed, 575 insertions, 38 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 |
diff --git a/spec/outputs/5.1/loops.lua b/spec/outputs/5.1/loops.lua index 57b19be..e4f2871 100644 --- a/spec/outputs/5.1/loops.lua +++ b/spec/outputs/5.1/loops.lua | |||
@@ -60,8 +60,8 @@ do | |||
60 | local y = hello[_index_0] | 60 | local y = hello[_index_0] |
61 | if y % 2 == 0 then | 61 | if y % 2 == 0 then |
62 | _accum_0[_len_0] = y | 62 | _accum_0[_len_0] = y |
63 | _len_0 = _len_0 + 1 | ||
63 | end | 64 | end |
64 | _len_0 = _len_0 + 1 | ||
65 | end | 65 | end |
66 | x = _accum_0 | 66 | x = _accum_0 |
67 | end | 67 | end |
@@ -132,13 +132,11 @@ do | |||
132 | end | 132 | end |
133 | do | 133 | do |
134 | local _accum_0 = { } | 134 | local _accum_0 = { } |
135 | local _len_0 = 1 | ||
136 | local _list_2 = 3 | 135 | local _list_2 = 3 |
137 | for _index_0 = 1, #_list_2 do | 136 | for _index_0 = 1, #_list_2 do |
138 | local thing = _list_2[_index_0] | 137 | local thing = _list_2[_index_0] |
139 | y = "hello" | 138 | y = "hello" |
140 | break | 139 | break |
141 | _len_0 = _len_0 + 1 | ||
142 | end | 140 | end |
143 | x = _accum_0 | 141 | x = _accum_0 |
144 | end | 142 | end |
@@ -489,3 +487,131 @@ do | |||
489 | end | 487 | end |
490 | until false | 488 | until false |
491 | end | 489 | end |
490 | local _anon_func_0 = function(i, tb) | ||
491 | local _accum_0 = { } | ||
492 | local _len_0 = 1 | ||
493 | while tb[i] do | ||
494 | i = i + 1 | ||
495 | _accum_0[_len_0] = i - 1 | ||
496 | _len_0 = _len_0 + 1 | ||
497 | end | ||
498 | return _accum_0 | ||
499 | end | ||
500 | do | ||
501 | local index | ||
502 | do | ||
503 | local _accum_0 | ||
504 | for i = 1, #tb do | ||
505 | if tb[i] then | ||
506 | _accum_0 = i | ||
507 | break | ||
508 | end | ||
509 | end | ||
510 | index = _accum_0 | ||
511 | end | ||
512 | f((function() | ||
513 | local _accum_0 | ||
514 | for i = 1, #tb do | ||
515 | if tb[i] then | ||
516 | _accum_0 = i | ||
517 | break | ||
518 | end | ||
519 | end | ||
520 | return _accum_0 | ||
521 | end)()) | ||
522 | f((function() | ||
523 | local _accum_0 = { } | ||
524 | local _len_0 = 1 | ||
525 | for i = 1, #tb do | ||
526 | if tb[i] then | ||
527 | _accum_0[_len_0] = i | ||
528 | _len_0 = _len_0 + 1 | ||
529 | end | ||
530 | end | ||
531 | return _accum_0 | ||
532 | end)()) | ||
533 | i = 1 | ||
534 | local ids | ||
535 | do | ||
536 | local _accum_0 = { } | ||
537 | local _len_0 = 1 | ||
538 | while tb[i] do | ||
539 | i = i + 1 | ||
540 | _accum_0[_len_0] = i - 1 | ||
541 | _len_0 = _len_0 + 1 | ||
542 | end | ||
543 | ids = _accum_0 | ||
544 | end | ||
545 | i = 1 | ||
546 | local idx | ||
547 | do | ||
548 | local _accum_0 | ||
549 | while tb[i] do | ||
550 | i = i + 1 | ||
551 | _accum_0 = i - 1 | ||
552 | break | ||
553 | end | ||
554 | idx = _accum_0 | ||
555 | end | ||
556 | local f1 | ||
557 | f1 = function() | ||
558 | i = 1 | ||
559 | return f(_anon_func_0(i, tb)) | ||
560 | end | ||
561 | i = 1 | ||
562 | f((function() | ||
563 | local _accum_0 | ||
564 | while tb[i] do | ||
565 | i = i + 1 | ||
566 | _accum_0 = i - 1 | ||
567 | break | ||
568 | end | ||
569 | return _accum_0 | ||
570 | end)()) | ||
571 | local _accum_0 = { } | ||
572 | local _len_0 = 1 | ||
573 | local _list_3 = items | ||
574 | for _index_0 = 1, #_list_3 do | ||
575 | local item = _list_3[_index_0] | ||
576 | local _type_0 = type(item) | ||
577 | local _tab_0 = "table" == _type_0 or "userdata" == _type_0 | ||
578 | if _tab_0 then | ||
579 | local value = item.value | ||
580 | if "A" == item.type and value ~= nil then | ||
581 | if value > 5 then | ||
582 | _accum_0[_len_0] = item | ||
583 | _len_0 = _len_0 + 1 | ||
584 | end | ||
585 | end | ||
586 | end | ||
587 | end | ||
588 | list = _accum_0 | ||
589 | end | ||
590 | do | ||
591 | repeat | ||
592 | print(1) | ||
593 | until true | ||
594 | do | ||
595 | local _accum_0 | ||
596 | repeat | ||
597 | a = func() | ||
598 | _accum_0 = a.x | ||
599 | break | ||
600 | until a.v | ||
601 | x = _accum_0 | ||
602 | end | ||
603 | local items | ||
604 | local _accum_0 = { } | ||
605 | local _len_0 = 1 | ||
606 | repeat | ||
607 | local item = getItem() | ||
608 | if not item then | ||
609 | break | ||
610 | end | ||
611 | if item.value > 0 then | ||
612 | _accum_0[_len_0] = item | ||
613 | _len_0 = _len_0 + 1 | ||
614 | end | ||
615 | until false | ||
616 | items = _accum_0 | ||
617 | end | ||
diff --git a/spec/outputs/5.1/try_catch.lua b/spec/outputs/5.1/try_catch.lua index d4c80c1..d2b58bc 100644 --- a/spec/outputs/5.1/try_catch.lua +++ b/spec/outputs/5.1/try_catch.lua | |||
@@ -8,10 +8,10 @@ local _anon_func_2 = function(tb) | |||
8 | return tb.func() | 8 | return tb.func() |
9 | end | 9 | end |
10 | local _anon_func_3 = function(tb) | 10 | local _anon_func_3 = function(tb) |
11 | return tb.func() | 11 | return (tb.func()) |
12 | end | 12 | end |
13 | local _anon_func_4 = function(tb) | 13 | local _anon_func_4 = function(tb) |
14 | return tb:func(1, 2, 3) | 14 | return (tb:func(1, 2, 3)) |
15 | end | 15 | end |
16 | local _anon_func_5 = function(tb) | 16 | local _anon_func_5 = function(tb) |
17 | return tb.func(1) | 17 | return tb.func(1) |
@@ -22,6 +22,43 @@ end | |||
22 | local _anon_func_7 = function(a, b, c, tb) | 22 | local _anon_func_7 = function(a, b, c, tb) |
23 | return tb.f(a, b, c) | 23 | return tb.f(a, b, c) |
24 | end | 24 | end |
25 | local _anon_func_8 = function(_arg_0, ...) | ||
26 | local ok = _arg_0 | ||
27 | return ... | ||
28 | end | ||
29 | local _anon_func_10 = function(_arg_0, ...) | ||
30 | local _ok_0 = _arg_0 | ||
31 | if _ok_0 then | ||
32 | return ... | ||
33 | end | ||
34 | end | ||
35 | local _anon_func_9 = function(func, pcall) | ||
36 | return _anon_func_10(pcall(func)) | ||
37 | end | ||
38 | local _anon_func_12 = function(_arg_0, ...) | ||
39 | local _ok_0 = _arg_0 | ||
40 | if _ok_0 then | ||
41 | return ... | ||
42 | end | ||
43 | end | ||
44 | local _anon_func_11 = function(func, pcall) | ||
45 | return _anon_func_12(pcall(func)) | ||
46 | end | ||
47 | local _anon_func_14 = function(_arg_0, ...) | ||
48 | local _ok_0 = _arg_0 | ||
49 | if _ok_0 then | ||
50 | return ... | ||
51 | end | ||
52 | end | ||
53 | local _anon_func_13 = function(func, print, xpcall) | ||
54 | return _anon_func_14(xpcall(function() | ||
55 | print(123) | ||
56 | return func() | ||
57 | end, function(e) | ||
58 | print(e) | ||
59 | return e | ||
60 | end)) | ||
61 | end | ||
25 | local f | 62 | local f |
26 | f = function() | 63 | f = function() |
27 | xpcall(function() | 64 | xpcall(function() |
@@ -64,7 +101,7 @@ f = function() | |||
64 | print("OK") | 101 | print("OK") |
65 | end | 102 | end |
66 | if xpcall(function() | 103 | if xpcall(function() |
67 | return func(1) | 104 | return (func(1)) |
68 | end, function(err) | 105 | end, function(err) |
69 | return print(err) | 106 | return print(err) |
70 | end) then | 107 | end) then |
@@ -104,10 +141,236 @@ f = function() | |||
104 | do | 141 | do |
105 | x(function() | 142 | x(function() |
106 | local tb, a, b, c | 143 | local tb, a, b, c |
107 | f = function() | 144 | local f1 |
145 | f1 = function() | ||
108 | return pcall(_anon_func_7, a, b, c, tb) | 146 | return pcall(_anon_func_7, a, b, c, tb) |
109 | end | 147 | end |
110 | end) | 148 | end) |
111 | end | 149 | end |
150 | do | ||
151 | local f1 | ||
152 | f1 = function() | ||
153 | do | ||
154 | return _anon_func_8(pcall(function() | ||
155 | return func() | ||
156 | end)) | ||
157 | end | ||
158 | end | ||
159 | end | ||
160 | do | ||
161 | local func | ||
162 | local a, b, c | ||
163 | local _ok_0, _ret_0, _ret_1, _ret_2 = pcall(func) | ||
164 | if _ok_0 then | ||
165 | a, b, c = _ret_0, _ret_1, _ret_2 | ||
166 | end | ||
167 | end | ||
168 | do | ||
169 | local a, b, c | ||
170 | local _ok_0, _ret_0, _ret_1, _ret_2 = pcall(function() | ||
171 | return func() | ||
172 | end) | ||
173 | if _ok_0 then | ||
174 | a, b, c = _ret_0, _ret_1, _ret_2 | ||
175 | end | ||
176 | end | ||
177 | do | ||
178 | local a | ||
179 | local _exp_0 = (_anon_func_9(func, pcall)) | ||
180 | if _exp_0 ~= nil then | ||
181 | a = _exp_0 | ||
182 | else | ||
183 | a = "default" | ||
184 | end | ||
185 | end | ||
186 | do | ||
187 | f(_anon_func_11(func, pcall)) | ||
188 | end | ||
189 | do | ||
190 | f(_anon_func_13(func, print, xpcall)) | ||
191 | end | ||
112 | return nil | 192 | return nil |
113 | end | 193 | end |
194 | local _anon_func_15 = function(a, b, c, tb) | ||
195 | return tb.f(a, b, c) | ||
196 | end | ||
197 | local _anon_func_16 = function(_arg_0, ...) | ||
198 | local ok = _arg_0 | ||
199 | return ... | ||
200 | end | ||
201 | do | ||
202 | xpcall(function() | ||
203 | return func(1, 2, 3) | ||
204 | end, function(err) | ||
205 | return print(err) | ||
206 | end) | ||
207 | xpcall(function() | ||
208 | return func(1, 2, 3) | ||
209 | end, function(err) | ||
210 | return print(err) | ||
211 | end) | ||
212 | pcall(function() | ||
213 | print("trying") | ||
214 | return func(1, 2, 3) | ||
215 | end) | ||
216 | do | ||
217 | local success, result = xpcall(function() | ||
218 | return func(1, 2, 3) | ||
219 | end, function(err) | ||
220 | return print(err) | ||
221 | end) | ||
222 | success, result = pcall(function() | ||
223 | return func(1, 2, 3) | ||
224 | end) | ||
225 | end | ||
226 | local tb = { } | ||
227 | pcall(function() | ||
228 | return tb.func | ||
229 | end) | ||
230 | pcall(function() | ||
231 | return tb.func() | ||
232 | end) | ||
233 | pcall(function() | ||
234 | return tb.func() | ||
235 | end) | ||
236 | pcall(function() | ||
237 | return (tb.func()) | ||
238 | end) | ||
239 | pcall(function() | ||
240 | return (tb:func(1, 2, 3)) | ||
241 | end) | ||
242 | pcall(function() | ||
243 | return tb.func(1) | ||
244 | end) | ||
245 | pcall(function() | ||
246 | return tb.func(1) | ||
247 | end) | ||
248 | if (xpcall(function() | ||
249 | return func(1) | ||
250 | end, function(err) | ||
251 | return print(err) | ||
252 | end)) then | ||
253 | print("OK") | ||
254 | end | ||
255 | if xpcall(function() | ||
256 | return (func(1)) | ||
257 | end, function(err) | ||
258 | return print(err) | ||
259 | end) then | ||
260 | print("OK") | ||
261 | end | ||
262 | do | ||
263 | do | ||
264 | local success, result = pcall(function() | ||
265 | return func("abc", 123) | ||
266 | end) | ||
267 | if success then | ||
268 | print(result) | ||
269 | end | ||
270 | end | ||
271 | local success, result = xpcall(function() | ||
272 | return func("abc", 123) | ||
273 | end, function(err) | ||
274 | return print(err) | ||
275 | end) | ||
276 | success, result = xpcall(function() | ||
277 | return func("abc", 123) | ||
278 | end, function(err) | ||
279 | return print(err) | ||
280 | end) | ||
281 | if success then | ||
282 | print(result) | ||
283 | end | ||
284 | end | ||
285 | do | ||
286 | pcall(function() | ||
287 | return func(1, 2, 3) | ||
288 | end) | ||
289 | pcall(function() | ||
290 | return func(1, 2, 3) | ||
291 | end) | ||
292 | end | ||
293 | do | ||
294 | x(function() | ||
295 | local tb, a, b, c | ||
296 | local f1 | ||
297 | f1 = function() | ||
298 | return pcall(_anon_func_15, a, b, c, tb) | ||
299 | end | ||
300 | end) | ||
301 | end | ||
302 | do | ||
303 | local f1 | ||
304 | f1 = function() | ||
305 | do | ||
306 | return _anon_func_16(pcall(function() | ||
307 | return func() | ||
308 | end)) | ||
309 | end | ||
310 | end | ||
311 | end | ||
312 | do | ||
313 | local func | ||
314 | local a, b, c | ||
315 | local _ok_0, _ret_0, _ret_1, _ret_2 = pcall(func) | ||
316 | if _ok_0 then | ||
317 | a, b, c = _ret_0, _ret_1, _ret_2 | ||
318 | end | ||
319 | end | ||
320 | do | ||
321 | local a, b, c | ||
322 | local _ok_0, _ret_0, _ret_1, _ret_2 = pcall(function() | ||
323 | return func() | ||
324 | end) | ||
325 | if _ok_0 then | ||
326 | a, b, c = _ret_0, _ret_1, _ret_2 | ||
327 | end | ||
328 | end | ||
329 | do | ||
330 | local a | ||
331 | local _exp_0 = ((function() | ||
332 | return (function(_arg_0, ...) | ||
333 | local _ok_0 = _arg_0 | ||
334 | if _ok_0 then | ||
335 | return ... | ||
336 | end | ||
337 | end)(pcall(function() | ||
338 | return func() | ||
339 | end)) | ||
340 | end)()) | ||
341 | if _exp_0 ~= nil then | ||
342 | a = _exp_0 | ||
343 | else | ||
344 | a = "default" | ||
345 | end | ||
346 | end | ||
347 | do | ||
348 | f((function() | ||
349 | return (function(_arg_0, ...) | ||
350 | local _ok_0 = _arg_0 | ||
351 | if _ok_0 then | ||
352 | return ... | ||
353 | end | ||
354 | end)(pcall(function() | ||
355 | return func() | ||
356 | end)) | ||
357 | end)()) | ||
358 | end | ||
359 | do | ||
360 | f((function() | ||
361 | return (function(_arg_0, ...) | ||
362 | local _ok_0 = _arg_0 | ||
363 | if _ok_0 then | ||
364 | return ... | ||
365 | end | ||
366 | end)(xpcall(function() | ||
367 | print(123) | ||
368 | return func() | ||
369 | end, function(e) | ||
370 | print(e) | ||
371 | return e | ||
372 | end)) | ||
373 | end)()) | ||
374 | end | ||
375 | end | ||
376 | return nil | ||