aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/comprehension.moon2
-rw-r--r--spec/inputs/destructure.moon7
-rw-r--r--spec/inputs/existential.moon16
-rw-r--r--spec/inputs/import.moon19
4 files changed, 40 insertions, 4 deletions
diff --git a/spec/inputs/comprehension.moon b/spec/inputs/comprehension.moon
index f07cf89..b6adb94 100644
--- a/spec/inputs/comprehension.moon
+++ b/spec/inputs/comprehension.moon
@@ -47,6 +47,6 @@ ok(a,b,c) for {a,b,c} in things
47_ = [item for item in *items[1 + 2,3+4]] 47_ = [item for item in *items[1 + 2,3+4]]
48_ = [item for item in *items[hello! * 4, 2 - thing[4]]] 48_ = [item for item in *items[hello! * 4, 2 - thing[4]]]
49 49
50 50list = [item?\invoke 123 for item in items]
51 51
52nil 52nil
diff --git a/spec/inputs/destructure.moon b/spec/inputs/destructure.moon
index 2509968..5bc7810 100644
--- a/spec/inputs/destructure.moon
+++ b/spec/inputs/destructure.moon
@@ -95,6 +95,11 @@ _ = (z) ->
95 95
96do 96do
97 z = "oo" 97 z = "oo"
98 (k) -> 98 _ = (k) ->
99 {a,b,c} = z 99 {a,b,c} = z
100 100
101do
102 {function:{end:endVar}} = thing
103
104do
105 {if:{a,b,c}} = thing
diff --git a/spec/inputs/existential.moon b/spec/inputs/existential.moon
index 97e8de0..eaa3266 100644
--- a/spec/inputs/existential.moon
+++ b/spec/inputs/existential.moon
@@ -1,8 +1,20 @@
1if {:x} = a?.if?\then?(123)? @?\function 998 1
2f?!
3
4x = tab?.value
5
6print abc?["hello world"]?.xyz
7
8if print and x?
2 print x 9 print x
3 10
11@?\func 998
12
4with abc?!\func?! 13with abc?!\func?!
5 if \p? "abc" 14 if \p? "abc"
6 return 123 15 return 123
7 16
8@?\func 998 17if {:x} = a?.if?\then?(123)? @?\function 998
18 print x
19
20
diff --git a/spec/inputs/import.moon b/spec/inputs/import.moon
index d86d724..ef6f4ee 100644
--- a/spec/inputs/import.moon
+++ b/spec/inputs/import.moon
@@ -46,3 +46,22 @@ do
46 c 46 c
47 from z 47 from z
48 48
49
50do
51 import 'module'
52 import 'module_x'
53 import "d-a-s-h-e-s"
54 import "module.part"
55
56do
57 import "player" as Player
58 import "lpeg" as {:C, :Ct, :Cmt}
59
60do
61 export *
62 import 'module'
63 import 'module_x'
64 import "org.package.module-y"
65
66do
67 import "org.package.module" as {function:func,if:ifVar}