diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/assign.moon | 3 | ||||
-rw-r--r-- | spec/inputs/destructure.moon | 9 | ||||
-rw-r--r-- | spec/inputs/syntax.moon | 9 |
3 files changed, 17 insertions, 4 deletions
diff --git a/spec/inputs/assign.moon b/spec/inputs/assign.moon index 4e50147..e8fcbfd 100644 --- a/spec/inputs/assign.moon +++ b/spec/inputs/assign.moon | |||
@@ -26,5 +26,4 @@ else | |||
26 | print "the other" | 26 | print "the other" |
27 | "nothing", "yeah" | 27 | "nothing", "yeah" |
28 | 28 | ||
29 | 29 | c, d = 1, 2 if true | |
30 | |||
diff --git a/spec/inputs/destructure.moon b/spec/inputs/destructure.moon index e0f2198..d61b6ae 100644 --- a/spec/inputs/destructure.moon +++ b/spec/inputs/destructure.moon | |||
@@ -103,3 +103,12 @@ do | |||
103 | 103 | ||
104 | do | 104 | do |
105 | {if:{a,b,c}} = thing | 105 | {if:{a,b,c}} = thing |
106 | |||
107 | do | ||
108 | {:a, :b} = {a: "Hello", b: "World"} if true | ||
109 | |||
110 | {days, hours, mins, secs} = [tonumber a for a in *{ | ||
111 | string.match "1 2 3 4", "(.+)%s(.+)%s(.+)%s(.+)" | ||
112 | }] | ||
113 | |||
114 | {:one, :two, :three} = {w,true for w in foo\gmatch("%S+")} | ||
diff --git a/spec/inputs/syntax.moon b/spec/inputs/syntax.moon index abee3e3..ae3fc0c 100644 --- a/spec/inputs/syntax.moon +++ b/spec/inputs/syntax.moon | |||
@@ -281,10 +281,15 @@ It's OK. | |||
281 | func --[[port]] 3000, --[[ip]] "192.168.1.1" | 281 | func --[[port]] 3000, --[[ip]] "192.168.1.1" |
282 | 282 | ||
283 | f = -> | 283 | f = -> |
284 | a,b, \ | 284 | a,b, |
285 | c,d, \ | 285 | c,d, |
286 | e,f | 286 | e,f |
287 | 287 | ||
288 | f = -> | ||
289 | a,b \ | ||
290 | ,c,d \ | ||
291 | ,e,f | ||
292 | |||
288 | with obj | 293 | with obj |
289 | invoke \ | 294 | invoke \ |
290 | --[[arg1]] \func!, | 295 | --[[arg1]] \func!, |