Skip to content

Commit d772547

Browse files
committed
update export tests
1 parent 1bff5ea commit d772547

File tree

2 files changed

+108
-92
lines changed

2 files changed

+108
-92
lines changed

tests/inputs/export.moon

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11

2-
export a,b,c = 223, 343
3-
export cool = "dad"
2+
do
3+
export a,b,c = 223, 343
4+
export cool = "dad"
45

5-
export class Something
6-
umm: "cool"
6+
do
7+
export class Something
8+
umm: "cool"
79

8-
What = if this
9-
232
10-
else
11-
4343
10+
do
11+
export a,b,c
12+
a,b,c,d = "hello"
1213

13-
export a,b,c
1414

15-
a,b,c,d = "hello"
15+
do
16+
What = if this
17+
232
18+
else
19+
4343
1620

17-
export ^
21+
export ^
1822

19-
another = 3434
20-
Another = 7890
23+
another = 3434
24+
Another = 7890
2125

22-
if inner then Yeah = "10000"
26+
if inner then Yeah = "10000"
2327

24-
What = if this
25-
232
26-
else
27-
4343
28+
What = if this
29+
232
30+
else
31+
4343
2832

29-
export *
3033

31-
What = if this
32-
232
33-
else
34-
4343
34+
do
35+
export *
3536

36-
x,y,z = 1,2,3
37+
What = if this
38+
232
39+
else
40+
4343
3741

38-
y = ->
39-
hallo = 3434
42+
x,y,z = 1,2,3
4043

41-
with tmp
42-
j = 2000
44+
y = ->
45+
hallo = 3434
46+
47+
with tmp
48+
j = 2000
4349

4450

tests/outputs/export.lua

Lines changed: 74 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,83 @@
1-
a, b, c = 223, 343
2-
cool = "dad"
31
do
4-
local _parent_0 = nil
5-
local _base_0 = {
6-
umm = "cool"
7-
}
8-
_base_0.__index = _base_0
9-
if _parent_0 then
10-
setmetatable(_base_0, _parent_0.__base)
11-
end
12-
local _class_0 = setmetatable({
13-
__init = function(self, ...)
14-
if _parent_0 then
15-
return _parent_0.__init(self, ...)
16-
end
17-
end,
18-
__base = _base_0,
19-
__name = "Something",
20-
__parent = _parent_0
21-
}, {
22-
__index = function(cls, name)
23-
local val = rawget(_base_0, name)
24-
if val == nil and _parent_0 then
25-
return _parent_0[name]
26-
else
27-
return val
2+
a, b, c = 223, 343
3+
cool = "dad"
4+
end
5+
do
6+
do
7+
local _parent_0 = nil
8+
local _base_0 = {
9+
umm = "cool"
10+
}
11+
_base_0.__index = _base_0
12+
if _parent_0 then
13+
setmetatable(_base_0, _parent_0.__base)
14+
end
15+
local _class_0 = setmetatable({
16+
__init = function(self, ...)
17+
if _parent_0 then
18+
return _parent_0.__init(self, ...)
19+
end
20+
end,
21+
__base = _base_0,
22+
__name = "Something",
23+
__parent = _parent_0
24+
}, {
25+
__index = function(cls, name)
26+
local val = rawget(_base_0, name)
27+
if val == nil and _parent_0 then
28+
return _parent_0[name]
29+
else
30+
return val
31+
end
32+
end,
33+
__call = function(cls, ...)
34+
local _self_0 = setmetatable({}, _base_0)
35+
cls.__init(_self_0, ...)
36+
return _self_0
2837
end
29-
end,
30-
__call = function(cls, ...)
31-
local _self_0 = setmetatable({}, _base_0)
32-
cls.__init(_self_0, ...)
33-
return _self_0
38+
})
39+
_base_0.__class = _class_0
40+
if _parent_0 and _parent_0.__inherited then
41+
_parent_0.__inherited(_parent_0, _class_0)
3442
end
35-
})
36-
_base_0.__class = _class_0
37-
if _parent_0 and _parent_0.__inherited then
38-
_parent_0.__inherited(_parent_0, _class_0)
43+
Something = _class_0
3944
end
40-
Something = _class_0
41-
end
42-
local What
43-
if this then
44-
What = 232
45-
else
46-
What = 4343
47-
end
48-
local d
49-
a, b, c, d = "hello"
50-
local another = 3434
51-
Another = 7890
52-
if inner then
53-
local Yeah = "10000"
54-
end
55-
if this then
56-
What = 232
57-
else
58-
What = 4343
5945
end
60-
if this then
61-
What = 232
62-
else
63-
What = 4343
46+
do
47+
local d
48+
a, b, c, d = "hello"
6449
end
65-
x, y, z = 1, 2, 3
66-
y = function()
67-
local hallo = 3434
50+
do
51+
local What
52+
if this then
53+
What = 232
54+
else
55+
What = 4343
56+
end
57+
local another = 3434
58+
Another = 7890
59+
if inner then
60+
local Yeah = "10000"
61+
end
62+
if this then
63+
What = 232
64+
else
65+
What = 4343
66+
end
6867
end
6968
do
70-
local _with_0 = tmp
71-
local j = 2000
72-
return _with_0
69+
if this then
70+
local What = 232
71+
else
72+
local What = 4343
73+
end
74+
x, y, z = 1, 2, 3
75+
y = function()
76+
local hallo = 3434
77+
end
78+
do
79+
local _with_0 = tmp
80+
local j = 2000
81+
return _with_0
82+
end
7383
end

0 commit comments

Comments
 (0)