diff options
Diffstat (limited to 'spec/inputs/lists.yue')
-rw-r--r-- | spec/inputs/lists.yue | 24 |
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) -> | |||
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 | with 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 | |||
86 | do | ||
87 | [a, b] = hello | ||
88 | [name = "nameless", job = "jobless"] = person | ||
89 | |||
90 | nil | ||