Skip to content

Commit e963089

Browse files
committed
Fixing issue #206.
1 parent 9750786 commit e963089

File tree

15 files changed

+150
-92
lines changed

15 files changed

+150
-92
lines changed

spec/outputs/5.1/attrib.lua

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ do
136136
end
137137
local b
138138
if not false then
139-
if x then
140-
b = 1
141-
end
139+
b = ((function()
140+
if x then
141+
return 1
142+
end
143+
end)())
142144
end
143145
local _close_0
144146
if (function()
@@ -164,10 +166,12 @@ do
164166
end)(pcall(function()
165167
local c
166168
if true then
167-
local _exp_0 = x
168-
if "abc" == _exp_0 then
169-
c = 998
170-
end
169+
c = ((function()
170+
local _exp_0 = x
171+
if "abc" == _exp_0 then
172+
return 998
173+
end
174+
end)())
171175
end
172176
local d
173177
if (function()

spec/outputs/5.1/try_catch.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ local _anon_func_2 = function(tb)
88
return tb.func()
99
end
1010
local _anon_func_3 = function(tb)
11-
return tb.func()
11+
return (tb.func())
1212
end
1313
local _anon_func_4 = function(tb)
14-
return tb:func(1, 2, 3)
14+
return (tb:func(1, 2, 3))
1515
end
1616
local _anon_func_5 = function(tb)
1717
return tb.func(1)
@@ -64,7 +64,7 @@ f = function()
6464
print("OK")
6565
end
6666
if xpcall(function()
67-
return func(1)
67+
return (func(1))
6868
end, function(err)
6969
return print(err)
7070
end) then

spec/outputs/assign.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ local x
3636
do
3737
local f = getHandler()
3838
if f then
39-
do
39+
x = ((function()
4040
f()
41-
x = 123
42-
end
41+
return 123
42+
end)())
4343
end
4444
end
4545
local _anon_func_0 = function(print)

spec/outputs/attrib.lua

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,21 @@ do
5656
end
5757
local b
5858
if not false then
59-
if x then
60-
b = 1
61-
end
59+
b = ((function()
60+
if x then
61+
return 1
62+
end
63+
end)())
6264
end
6365
local _close_0 <close> = b
6466
local c
6567
if true then
66-
local _exp_0 = x
67-
if "abc" == _exp_0 then
68-
c = 998
69-
end
68+
c = ((function()
69+
local _exp_0 = x
70+
if "abc" == _exp_0 then
71+
return 998
72+
end
73+
end)())
7074
end
7175
local d
7276
if (function()

spec/outputs/do.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ local t = {
3232
}
3333
return function(y, k)
3434
if y == nil then
35-
do
35+
y = ((function()
3636
x = 10 + 2
37-
y = x
38-
end
37+
return x
38+
end)())
3939
end
4040
if k == nil then
4141
do

spec/outputs/syntax.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,11 @@ x = 0
239239
local _list_0 = values
240240
for _index_0 = 1, #_list_0 do
241241
local v = _list_0[_index_0]
242-
if ntype(v) == "fndef" then
243-
_ = x + 1
244-
end
242+
_ = ((function()
243+
if ntype(v) == "fndef" then
244+
return x + 1
245+
end
246+
end)())
245247
end
246248
hello = {
247249
something = world,

spec/outputs/try_catch.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ local _anon_func_2 = function(tb)
88
return tb.func()
99
end
1010
local _anon_func_3 = function(tb)
11-
return tb.func()
11+
return (tb.func())
1212
end
1313
local _anon_func_4 = function(tb)
14-
return tb:func(1, 2, 3)
14+
return (tb:func(1, 2, 3))
1515
end
1616
local _anon_func_5 = function(tb)
1717
return tb.func(1)
@@ -64,7 +64,7 @@ f = function()
6464
print("OK")
6565
end
6666
if xpcall(function()
67-
return func(1)
67+
return (func(1))
6868
end, function(err)
6969
return print(err)
7070
end) then

spec/outputs/unicode/assign.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ local _u53d8_u91cfx
3636
do
3737
local _u51fd_u6570 = _u83b7_u53d6_u5904_u7406_u51fd_u6570()
3838
if _u51fd_u6570 then
39-
do
39+
_u53d8_u91cfx = ((function()
4040
_u51fd_u6570()
41-
_u53d8_u91cfx = 123
42-
end
41+
return 123
42+
end)())
4343
end
4444
end
4545
local _anon_func_0 = function(_u6253_u5370)

spec/outputs/unicode/attrib.lua

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,21 @@ do
4848
end
4949
local _u5173_u95ed_u53d8_u91cfb
5050
if not false then
51-
if _u6761_u4ef6x then
52-
_u5173_u95ed_u53d8_u91cfb = 1
53-
end
51+
_u5173_u95ed_u53d8_u91cfb = ((function()
52+
if _u6761_u4ef6x then
53+
return 1
54+
end
55+
end)())
5456
end
5557
local _close_0 <close> = _u5173_u95ed_u53d8_u91cfb
5658
local _u5e38_u91cfc
5759
if true then
58-
local _exp_0 = _u6761_u4ef6x
59-
if "abc" == _exp_0 then
60-
_u5e38_u91cfc = 998
61-
end
60+
_u5e38_u91cfc = ((function()
61+
local _exp_0 = _u6761_u4ef6x
62+
if "abc" == _exp_0 then
63+
return 998
64+
end
65+
end)())
6266
end
6367
local _u5173_u95ed_u53d8_u91cfd
6468
if (function()

spec/outputs/unicode/do.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ local _u53d8_u91cft = {
3232
}
3333
return function(_u53c2_u6570y, _u53c2_u6570k)
3434
if _u53c2_u6570y == nil then
35-
do
35+
_u53c2_u6570y = ((function()
3636
_u53d8_u91cfx = 10 + 2
37-
_u53c2_u6570y = _u53d8_u91cfx
38-
end
37+
return _u53d8_u91cfx
38+
end)())
3939
end
4040
if _u53c2_u6570k == nil then
4141
do

0 commit comments

Comments
 (0)