summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-08-15 01:35:20 +0800
committerLi Jin <dragon-fly@qq.com>2021-08-15 01:35:20 +0800
commit7295e9efe092fca4ab6eebf6408af93d5f56dd80 (patch)
treea84ae20259c370aff3d65195152758d32eee52d7 /spec
parent2511572a2c9f9cc8c79fa42163717ed840767545 (diff)
downloadyuescript-7295e9efe092fca4ab6eebf6408af93d5f56dd80.tar.gz
yuescript-7295e9efe092fca4ab6eebf6408af93d5f56dd80.tar.bz2
yuescript-7295e9efe092fca4ab6eebf6408af93d5f56dd80.zip
fix vararg issues. add new spec.
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/vararg.yue56
1 files changed, 56 insertions, 0 deletions
diff --git a/spec/inputs/vararg.yue b/spec/inputs/vararg.yue
new file mode 100644
index 0000000..c7b8ebf
--- /dev/null
+++ b/spec/inputs/vararg.yue
@@ -0,0 +1,56 @@
1join = (...) ->
2 f_with with a
3 \func!
4 f_with with a
5 \func ...
6
7 f_listcomp [items[i] for i = 1, 10]
8 f_listcomp [items[i] ... for i = 1, 10]
9 f_listcomp [item for item in *items]
10 f_listcomp [item ... for item in *items]
11
12 f_class class A
13 func!
14 f_class class A
15 func ...
16
17 f_tblcomp {k, v for k, v in pairs tb}
18 f_tblcomp {k, v ... for k, v in pairs tb}
19 f_tblcomp {item, true for item in *items}
20 f_tblcomp {item(...), true for item in *items}
21
22 f_do do
23 func!
24 f_do do
25 func ...
26
27 f_while while false
28 func!
29 f_while while false
30 func ...
31
32 f_if if false
33 func!
34 f_if if false
35 func ...
36
37 f_unless unless true
38 func!
39 f_unless unless true
40 func ...
41
42 f_switch switch x
43 when "abc"
44 func!
45 f_switch switch x
46 when "abc"
47 func ...
48
49 f_eop func?!
50 f_eop func? ...
51
52 f_colon f!\func
53 f_colon f(...)\func
54
55 nil
56