From 60774555568dbc64866d088cb51e45f9434c0f89 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 8 Aug 2023 18:12:06 +0800 Subject: make vararg assignment work with line decorator. --- spec/inputs/vararg.yue | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec/inputs') diff --git a/spec/inputs/vararg.yue b/spec/inputs/vararg.yue index c7b8ebf..466a4a6 100644 --- a/spec/inputs/vararg.yue +++ b/spec/inputs/vararg.yue @@ -52,5 +52,27 @@ join = (...) -> f_colon f!\func f_colon f(...)\func + _ = -> + list = {1, 2, 3, 4, 5} + fn = (ok) -> + ok, table.unpack list + ok, ... = fn true + print ok, ... + + fn_many_args = -> + 10, nil, 20, nil, 30 + + ... = fn_many_args! + print select "#", ... + print ... + + do + ... = 1, 2 if true + print ... + + do + a, ... = 1, 2 unless true + print a, select '#', ... + nil -- cgit v1.2.3-55-g6feb