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/lists.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/lists.moon')
-rw-r--r-- | spec/inputs/lists.moon | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/inputs/lists.moon b/spec/inputs/lists.moon index ef5650c..15eb9ab 100644 --- a/spec/inputs/lists.moon +++ b/spec/inputs/lists.moon | |||
@@ -6,7 +6,7 @@ items = {1,2,3,4,5,6} | |||
6 | _ = [z for z in ipairs items when z > 4] | 6 | _ = [z for z in ipairs items when z > 4] |
7 | 7 | ||
8 | rad = [{a} for a in ipairs { | 8 | rad = [{a} for a in ipairs { |
9 | 1,2,3,4,5,6, | 9 | 1,2,3,4,5,6, |
10 | } when good_number a] | 10 | } when good_number a] |
11 | 11 | ||
12 | 12 | ||
@@ -17,11 +17,11 @@ require "util" | |||
17 | dump = (x) -> print util.dump x | 17 | dump = (x) -> print util.dump x |
18 | 18 | ||
19 | range = (count) -> | 19 | range = (count) -> |
20 | i = 0 | 20 | i = 0 |
21 | return coroutine.wrap -> | 21 | return coroutine.wrap -> |
22 | while i < count | 22 | while i < count |
23 | coroutine.yield i | 23 | coroutine.yield i |
24 | i = i + 1 | 24 | i = i + 1 |
25 | 25 | ||
26 | dump [x for x in range 10] | 26 | dump [x for x in range 10] |
27 | dump [{x, y} for x in range 5 when x > 2 for y in range 5] | 27 | dump [{x, y} for x in range 5 when x > 2 for y in range 5] |
@@ -61,7 +61,7 @@ print y for y in *x[a,b,c] | |||
61 | 61 | ||
62 | 62 | ||
63 | normal = (hello) -> | 63 | normal = (hello) -> |
64 | [x for x in yeah] | 64 | [x for x in yeah] |
65 | 65 | ||
66 | 66 | ||
67 | test = x 1,2,3,4,5 | 67 | test = x 1,2,3,4,5 |