diff options
| author | Li Jin <dragon-fly@qq.com> | 2020-01-25 17:48:03 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2020-01-25 17:48:03 +0800 |
| commit | ed317e62eb1cf98fde4461fc90c6cb1045ebc7e8 (patch) | |
| tree | 427e365939da39f31dbfa755675fb60bb141583d /spec/inputs/switch.moon | |
| parent | 4827d200604a086e2ad94edb4257c3abc7a3c4fc (diff) | |
| download | yuescript-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.moon | 72 |
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 | ||
| 2 | switch value | 2 | switch value |
| 3 | when "cool" | 3 | when "cool" |
| 4 | print "hello world" | 4 | print "hello world" |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | switch value | 7 | switch 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 | ||
| 14 | switch value | 14 | switch 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 | ||
| 24 | out = switch value | 24 | out = 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 | ||
| 28 | out = switch value | 28 | out = 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 | ||
| 33 | with something | 33 | with 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 | ||
| 40 | fix this | 40 | fix this |
| 41 | call_func switch something | 41 | call_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 | ||
| 47 | switch hi | 47 | switch hi |
| 48 | when hello or world | 48 | when hello or world |
| 49 | _ = greene | 49 | _ = greene |
| 50 | 50 | ||
| 51 | -- | 51 | -- |
| 52 | 52 | ||
| 53 | switch hi | 53 | switch 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 | ||
| 59 | switch hi | 59 | switch 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 | ||
