diff options
Diffstat (limited to 'spec/outputs/do.lua')
-rw-r--r-- | spec/outputs/do.lua | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/outputs/do.lua b/spec/outputs/do.lua new file mode 100644 index 0000000..96d1022 --- /dev/null +++ b/spec/outputs/do.lua | |||
@@ -0,0 +1,48 @@ | |||
1 | do | ||
2 | print("hello") | ||
3 | print("world") | ||
4 | end | ||
5 | local x | ||
6 | do | ||
7 | print("hello") | ||
8 | x = print("world") | ||
9 | end | ||
10 | local y | ||
11 | do | ||
12 | local things = "shhh" | ||
13 | y = function() | ||
14 | return "hello: " .. things | ||
15 | end | ||
16 | end | ||
17 | local _ | ||
18 | _ = function() | ||
19 | if something then | ||
20 | do | ||
21 | return "yeah" | ||
22 | end | ||
23 | end | ||
24 | end | ||
25 | local t = { | ||
26 | y = (function() | ||
27 | local number = 100 | ||
28 | return function(x) | ||
29 | return x + number | ||
30 | end | ||
31 | end)() | ||
32 | } | ||
33 | return function(y, k) | ||
34 | if y == nil then | ||
35 | y = ((function() | ||
36 | x = 10 + 2 | ||
37 | return x | ||
38 | end)()) | ||
39 | end | ||
40 | if k == nil then | ||
41 | do | ||
42 | k = "nothing" | ||
43 | end | ||
44 | end | ||
45 | do | ||
46 | return "uhhh" | ||
47 | end | ||
48 | end | ||