diff options
Diffstat (limited to 'spec/inputs')
| -rw-r--r-- | spec/inputs/vararg.yue | 22 |
1 files changed, 22 insertions, 0 deletions
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 = (...) -> | |||
| 52 | f_colon f!\func | 52 | f_colon f!\func |
| 53 | f_colon f(...)\func | 53 | f_colon f(...)\func |
| 54 | 54 | ||
| 55 | _ = -> | ||
| 56 | list = {1, 2, 3, 4, 5} | ||
| 57 | fn = (ok) -> | ||
| 58 | ok, table.unpack list | ||
| 59 | ok, ... = fn true | ||
| 60 | print ok, ... | ||
| 61 | |||
| 62 | fn_many_args = -> | ||
| 63 | 10, nil, 20, nil, 30 | ||
| 64 | |||
| 65 | ... = fn_many_args! | ||
| 66 | print select "#", ... | ||
| 67 | print ... | ||
| 68 | |||
| 69 | do | ||
| 70 | ... = 1, 2 if true | ||
| 71 | print ... | ||
| 72 | |||
| 73 | do | ||
| 74 | a, ... = 1, 2 unless true | ||
| 75 | print a, select '#', ... | ||
| 76 | |||
| 55 | nil | 77 | nil |
| 56 | 78 | ||
