aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-10-27 16:58:43 +0800
committerLi Jin <dragon-fly@qq.com>2023-10-27 16:58:43 +0800
commit7bfa002f3d4dcb62e6a301141be6d17889a94f55 (patch)
tree927eab759af3e333b1f7d80c3724ec4b869c02e1 /spec/inputs
parentbafe9b44212316a51ee00f7af15e881c81d96fe6 (diff)
downloadyuescript-7bfa002f3d4dcb62e6a301141be6d17889a94f55.tar.gz
yuescript-7bfa002f3d4dcb62e6a301141be6d17889a94f55.tar.bz2
yuescript-7bfa002f3d4dcb62e6a301141be6d17889a94f55.zip
fix a missing case for list destructuring.
Diffstat (limited to 'spec/inputs')
-rw-r--r--spec/inputs/destructure.yue8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/inputs/destructure.yue b/spec/inputs/destructure.yue
index d161fd8..73e4d33 100644
--- a/spec/inputs/destructure.yue
+++ b/spec/inputs/destructure.yue
@@ -80,6 +80,8 @@ do
80 for {x,y} in *thing 80 for {x,y} in *thing
81 print x,y 81 print x,y
82 82
83 for [x,y] in *thing
84 print x,y
83 85
84-- 86--
85 87
@@ -178,10 +180,16 @@ do
178 for {left = "null", right = false} in *tuples 180 for {left = "null", right = false} in *tuples
179 print left, right 181 print left, right
180 182
183 for [left = "null", right = false] in *tuples
184 print left, right
185
181do 186do
182 {_, a, _, b} = tb -- list placeholder 187 {_, a, _, b} = tb -- list placeholder
183 188
184do 189do
190 [a, _, b, _] = tb -- list placeholder
191
192do
185 {x: a.b = 1, y: a.c = 2} = x.x.x 193 {x: a.b = 1, y: a.c = 2} = x.x.x
186 194
187do 195do