diff options
author | Li Jin <dragon-fly@qq.com> | 2020-01-18 18:15:24 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2020-01-18 18:15:24 +0800 |
commit | 8d1af508f4173e4af6a4ea98584c1a86619f6a20 (patch) | |
tree | 0264c4b01f1152d8114cf46aea6fd773276c0b01 /spec/inputs/lists.moon | |
parent | f53ccb373efbf6f6f40284111df309e351c2c18f (diff) | |
download | yuescript-8d1af508f4173e4af6a4ea98584c1a86619f6a20.tar.gz yuescript-8d1af508f4173e4af6a4ea98584c1a86619f6a20.tar.bz2 yuescript-8d1af508f4173e4af6a4ea98584c1a86619f6a20.zip |
fix Moonscript issue 122, add support for ? operator.
Diffstat (limited to 'spec/inputs/lists.moon')
-rw-r--r-- | spec/inputs/lists.moon | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/inputs/lists.moon b/spec/inputs/lists.moon index c119185..e377d5e 100644 --- a/spec/inputs/lists.moon +++ b/spec/inputs/lists.moon | |||
@@ -3,14 +3,14 @@ hi = [x*2 for _, x in ipairs{1,2,3,4}] | |||
3 | 3 | ||
4 | items = {1,2,3,4,5,6} | 4 | items = {1,2,3,4,5,6} |
5 | 5 | ||
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 | ||
13 | [z for z in items for j in list when z > 4] | 13 | _ = [z for z in items for j in list when z > 4] |
14 | 14 | ||
15 | require "util" | 15 | require "util" |
16 | 16 | ||
@@ -32,7 +32,7 @@ print x,y for x in ipairs{1,2,4} for y in ipairs{1,2,3} when x != 2 | |||
32 | 32 | ||
33 | print "hello", x for x in items | 33 | print "hello", x for x in items |
34 | 34 | ||
35 | [x for x in x] | 35 | _ = [x for x in x] |
36 | x = [x for x in x] | 36 | x = [x for x in x] |
37 | 37 | ||
38 | print x,y for x in ipairs{1,2,4} for y in ipairs{1,2,3} when x != 2 | 38 | print x,y for x in ipairs{1,2,4} for y in ipairs{1,2,3} when x != 2 |
@@ -67,6 +67,6 @@ normal = (hello) -> | |||
67 | test = x 1,2,3,4,5 | 67 | test = x 1,2,3,4,5 |
68 | print thing for thing in *test | 68 | print thing for thing in *test |
69 | 69 | ||
70 | -> a = b for row in *rows | 70 | _ = -> a = b for row in *rows |
71 | 71 | ||
72 | 72 | ||