aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/class.moon2
-rw-r--r--spec/inputs/export.moon98
-rw-r--r--spec/inputs/export_default.moon15
-rw-r--r--spec/inputs/global.moon77
-rw-r--r--spec/inputs/import.moon2
5 files changed, 127 insertions, 67 deletions
diff --git a/spec/inputs/class.moon b/spec/inputs/class.moon
index 3288dc6..533694e 100644
--- a/spec/inputs/class.moon
+++ b/spec/inputs/class.moon
@@ -158,7 +158,7 @@ print (class WhatsUp).__name
158 158
159-- 159--
160 160
161export ^ 161global ^
162class Something 162class Something
163 _ = nil 163 _ = nil
164 164
diff --git a/spec/inputs/export.moon b/spec/inputs/export.moon
index a8c782c..9c906d5 100644
--- a/spec/inputs/export.moon
+++ b/spec/inputs/export.moon
@@ -1,77 +1,45 @@
1 1
2do 2export a,b,c = 223, 343, 123
3 export a,b,c = 223, 343 3export cool = "dad"
4 export cool = "dad"
5 4
6do 5d,e,f = 3, 2, 1
7 export class Something 6export d, e, f
8 umm: "cool"
9 7
10do 8export class Something
11 export a,b,c 9 umm: "cool"
12 a,b,c,d = "hello"
13 10
11export if this
12 232
13else
14 4343
14 15
15do 16export What = if this
16 What = if this 17 232
17 232 18else
18 else 19 4343
19 4343
20 20
21 export ^ 21export y = ->
22 hallo = 3434
22 23
23 another = 3434 24export with tmp
24 Another = 7890 25 j = 2000
25 26
26 if inner then Yeah = "10000" 27export cbVal = do
27 28 h = 100
28 What = if this 29 (x)<- f
29 232 30 return x h
30 else
31 4343
32
33
34do
35 export *
36
37 What = if this
38 232
39 else
40 4343
41
42 x,y,z = 1,2,3
43
44 y = ->
45 hallo = 3434
46
47 with tmp
48 j = 2000
49
50
51do
52 export *
53 x = 3434
54 if y then
55 x = 10
56
57do
58 export *
59 if y then
60 x = 10
61 x = 3434
62
63do
64 do
65 export *
66
67 k = 1212
68 31
69 do 32export y = ->
70 h = 100 33 h = 100
34 k = 100
71 35
72 y = -> 36export switch h
73 h = 100 37 when 100, 150 then 200
74 k = 100 38 when 200 then 300
39 else 0
75 40
76 h = 100 41export Constant = switch value
42 when "good" then 1
43 when "better" then 2
44 when "best" then 3
77 45
diff --git a/spec/inputs/export_default.moon b/spec/inputs/export_default.moon
new file mode 100644
index 0000000..73f43ac
--- /dev/null
+++ b/spec/inputs/export_default.moon
@@ -0,0 +1,15 @@
1
2print "OK"
3
4export default ->
5 print "hello"
6 123
7
8(x, fy)<- f 123, "abc" unless isOff
9print x
10(y, res)<- fy
11return if res
12 abc + y
13else
14 abc
15
diff --git a/spec/inputs/global.moon b/spec/inputs/global.moon
new file mode 100644
index 0000000..7d6cfde
--- /dev/null
+++ b/spec/inputs/global.moon
@@ -0,0 +1,77 @@
1
2do
3 global a,b,c = 223, 343
4 global cool = "dad"
5
6do
7 global class Something
8 umm: "cool"
9
10do
11 global a,b,c
12 a,b,c,d = "hello"
13
14
15do
16 What = if this
17 232
18 else
19 4343
20
21 global ^
22
23 another = 3434
24 Another = 7890
25
26 if inner then Yeah = "10000"
27
28 What = if this
29 232
30 else
31 4343
32
33
34do
35 global *
36
37 What = if this
38 232
39 else
40 4343
41
42 x,y,z = 1,2,3
43
44 y = ->
45 hallo = 3434
46
47 with tmp
48 j = 2000
49
50
51do
52 global *
53 x = 3434
54 if y then
55 x = 10
56
57do
58 global *
59 if y then
60 x = 10
61 x = 3434
62
63do
64 do
65 global *
66
67 k = 1212
68
69 do
70 h = 100
71
72 y = ->
73 h = 100
74 k = 100
75
76 h = 100
77
diff --git a/spec/inputs/import.moon b/spec/inputs/import.moon
index ded1ffd..99981f8 100644
--- a/spec/inputs/import.moon
+++ b/spec/inputs/import.moon
@@ -58,7 +58,7 @@ do
58 import "lpeg" as {:C, :Ct, :Cmt} 58 import "lpeg" as {:C, :Ct, :Cmt}
59 59
60do 60do
61 export * 61 global *
62 import 'module' 62 import 'module'
63 import 'module_x' 63 import 'module_x'
64 import "org.package.module-y" 64 import "org.package.module-y"