aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/lists.moon
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2020-01-18 18:15:24 +0800
committerLi Jin <dragon-fly@qq.com>2020-01-18 18:15:24 +0800
commit8d1af508f4173e4af6a4ea98584c1a86619f6a20 (patch)
tree0264c4b01f1152d8114cf46aea6fd773276c0b01 /spec/inputs/lists.moon
parentf53ccb373efbf6f6f40284111df309e351c2c18f (diff)
downloadyuescript-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.moon8
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
4items = {1,2,3,4,5,6} 4items = {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
8rad = [{a} for a in ipairs { 8rad = [{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
15require "util" 15require "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
33print "hello", x for x in items 33print "hello", x for x in items
34 34
35[x for x in x] 35_ = [x for x in x]
36x = [x for x in x] 36x = [x for x in x]
37 37
38print x,y for x in ipairs{1,2,4} for y in ipairs{1,2,3} when x != 2 38print 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) ->
67test = x 1,2,3,4,5 67test = x 1,2,3,4,5
68print thing for thing in *test 68print 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