aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/switch.moon
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-01-25 17:48:03 +0800
committerLi Jin <dragon-fly@qq.com>2020-01-25 17:48:03 +0800
commited317e62eb1cf98fde4461fc90c6cb1045ebc7e8 (patch)
tree427e365939da39f31dbfa755675fb60bb141583d /spec/inputs/switch.moon
parent4827d200604a086e2ad94edb4257c3abc7a3c4fc (diff)
downloadyuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.tar.gz
yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.tar.bz2
yuescript-ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8.zip
fix Moonscript issue 375.
Diffstat (limited to 'spec/inputs/switch.moon')
-rw-r--r--spec/inputs/switch.moon72
1 files changed, 36 insertions, 36 deletions
diff --git a/spec/inputs/switch.moon b/spec/inputs/switch.moon
index a028f98..ac3dbea 100644
--- a/spec/inputs/switch.moon
+++ b/spec/inputs/switch.moon
@@ -1,64 +1,64 @@
1 1
2switch value 2switch value
3 when "cool" 3 when "cool"
4 print "hello world" 4 print "hello world"
5 5
6 6
7switch value 7switch value
8 when "cool" 8 when "cool"
9 print "hello world" 9 print "hello world"
10 else 10 else
11 print "okay rad" 11 print "okay rad"
12 12
13 13
14switch value 14switch value
15 when "cool" 15 when "cool"
16 print "hello world" 16 print "hello world"
17 when "yeah" 17 when "yeah"
18 _ = [[FFFF]] + [[MMMM]] 18 _ = [[FFFF]] + [[MMMM]]
19 when 2323 + 32434 19 when 2323 + 32434
20 print "okay" 20 print "okay"
21 else 21 else
22 print "okay rad" 22 print "okay rad"
23 23
24out = switch value 24out = switch value
25 when "cool" then print "hello world" 25 when "cool" then print "hello world"
26 else print "okay rad" 26 else print "okay rad"
27 27
28out = switch value 28out = switch value
29 when "cool" then xxxx 29 when "cool" then xxxx
30 when "umm" then 34340 30 when "umm" then 34340
31 else error "this failed big time" 31 else error "this failed big time"
32 32
33with something 33with something
34 switch \value! 34 switch \value!
35 when .okay 35 when .okay
36 _ = "world" 36 _ = "world"
37 else 37 else
38 _ = "yesh" 38 _ = "yesh"
39 39
40fix this 40fix this
41call_func switch something 41call_func switch something
42 when 1 then "yes" 42 when 1 then "yes"
43 else "no" 43 else "no"
44 44
45-- 45--
46 46
47switch hi 47switch hi
48 when hello or world 48 when hello or world
49 _ = greene 49 _ = greene
50 50
51-- 51--
52 52
53switch hi 53switch hi
54 when "one", "two" 54 when "one", "two"
55 print "cool" 55 print "cool"
56 when "dad" 56 when "dad"
57 _ = no 57 _ = no
58 58
59switch hi 59switch hi
60 when 3+1, hello!, (-> 4)! 60 when 3+1, hello!, (-> 4)!
61 yello 61 yello
62 else 62 else
63 print "cool" 63 print "cool"
64 64