aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/lists.yue
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs/lists.yue')
-rw-r--r--spec/inputs/lists.yue24
1 files changed, 21 insertions, 3 deletions
diff --git a/spec/inputs/lists.yue b/spec/inputs/lists.yue
index 15eb9ab..921cae0 100644
--- a/spec/inputs/lists.yue
+++ b/spec/inputs/lists.yue
@@ -67,6 +67,24 @@ 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 72with tb
73 f [a] -- indexing
74 f [a,] -- list with one element
75 print v for v in *f[a,] -- table slicing in for-loop
76 f [] -- empty list
77 f[] = x -- table appending to f
78 [a] = x -- assign to tb[a]
79 [a,] = x -- list destructuring for x
80 [] = x -- table appending to tb
81 c = a in [1] -- check if a in tb[1]
82 c = a in [1,] -- check if a == 1
83 c = a in {1} -- check if a == 1
84 c = a in {1,} -- check if a == 1
85
86do
87 [a, b] = hello
88 [name = "nameless", job = "jobless"] = person
89
90nil