aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/destructure.yue
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-07-26 11:34:34 +0800
committerLi Jin <dragon-fly@qq.com>2022-07-26 11:34:34 +0800
commitf7150a004e26f446fbf7a47bae368f209248fa67 (patch)
tree28cbfc756cfef955a6a40f62d3395920938256db /spec/inputs/destructure.yue
parent13c7eb4252e8c4228fabf1ade13b7b9bcbd80656 (diff)
downloadyuescript-f7150a004e26f446fbf7a47bae368f209248fa67.tar.gz
yuescript-f7150a004e26f446fbf7a47bae368f209248fa67.tar.bz2
yuescript-f7150a004e26f446fbf7a47bae368f209248fa67.zip
make destructuring work on function multiple returned values, fix `a, b[] = 1` crashing issue, no longer support implicit declaring variable to be nil.
Diffstat (limited to 'spec/inputs/destructure.yue')
-rw-r--r--spec/inputs/destructure.yue8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/inputs/destructure.yue b/spec/inputs/destructure.yue
index 24282c0..53f9ea3 100644
--- a/spec/inputs/destructure.yue
+++ b/spec/inputs/destructure.yue
@@ -12,7 +12,7 @@ do
12 {:a,:b,:c,:d} = yeah 12 {:a,:b,:c,:d} = yeah
13 13
14 {a}, b = one, two 14 {a}, b = one, two
15 {b}, c = one 15 {b}, c = one, nil
16 {d}, e = one, two 16 {d}, e = one, two
17 17
18 x, {y} = one, two 18 x, {y} = one, two
@@ -22,7 +22,7 @@ do
22 22
23 {a, :b, c, :d, e, :f, g} = tbl 23 {a, :b, c, :d, e, :f, g} = tbl
24 24
25 do :a, :b, c = tbl 25 do :a, :b, c = tbl, nil
26 26
27 do a, :b, :c = tbl, _ 27 do a, :b, :c = tbl, _
28 28
@@ -187,3 +187,7 @@ do
187do 187do
188 const :width, :height = View.size 188 const :width, :height = View.size
189 const {:x = 0.0, :y = 0.0} = point 189 const {:x = 0.0, :y = 0.0} = point
190
191do
192 x1, x2, x3, a[], d, {b}, e, c.# = 1, 2, 3, f!
193 y1, :y2, :y3, y4 = f1!, f2!