From f7150a004e26f446fbf7a47bae368f209248fa67 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 26 Jul 2022 11:34:34 +0800 Subject: make destructuring work on function multiple returned values, fix `a, b[] = 1` crashing issue, no longer support implicit declaring variable to be nil. --- spec/inputs/destructure.yue | 8 ++++++-- spec/inputs/local.yue | 2 +- spec/inputs/syntax.yue | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'spec/inputs') 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 {:a,:b,:c,:d} = yeah {a}, b = one, two - {b}, c = one + {b}, c = one, nil {d}, e = one, two x, {y} = one, two @@ -22,7 +22,7 @@ do {a, :b, c, :d, e, :f, g} = tbl - do :a, :b, c = tbl + do :a, :b, c = tbl, nil do a, :b, :c = tbl, _ @@ -187,3 +187,7 @@ do do const :width, :height = View.size const {:x = 0.0, :y = 0.0} = point + +do + x1, x2, x3, a[], d, {b}, e, c.# = 1, 2, 3, f! + y1, :y2, :y3, y4 = f1!, f2! diff --git a/spec/inputs/local.yue b/spec/inputs/local.yue index 8e04742..a801fb7 100644 --- a/spec/inputs/local.yue +++ b/spec/inputs/local.yue @@ -3,7 +3,7 @@ do local a local a,b,c - b,g = 23232 + b,g = 23232,nil do diff --git a/spec/inputs/syntax.yue b/spec/inputs/syntax.yue index d18bd0e..e274f1a 100644 --- a/spec/inputs/syntax.yue +++ b/spec/inputs/syntax.yue @@ -2,7 +2,7 @@ a = 1 + 2* 3 / 6 -a, bunch, go, here = another, world +a, bunch, go, here = another, world, nil, nil func arg1, arg2, another, arg3 -- cgit v1.2.3-55-g6feb