aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs')
-rw-r--r--spec/inputs/destructure.yue10
-rw-r--r--spec/inputs/funcs.yue4
-rw-r--r--spec/inputs/string.yue4
-rw-r--r--spec/inputs/unicode/funcs.yue2
-rw-r--r--spec/inputs/unicode/vararg.yue4
-rw-r--r--spec/inputs/vararg.yue4
-rw-r--r--spec/inputs/with.yue4
7 files changed, 21 insertions, 11 deletions
diff --git a/spec/inputs/destructure.yue b/spec/inputs/destructure.yue
index b6250d0..179056c 100644
--- a/spec/inputs/destructure.yue
+++ b/spec/inputs/destructure.yue
@@ -278,5 +278,15 @@ do
278do 278do
279 {a, :abc, b, :def, ...sub, d, e} = tb 279 {a, :abc, b, :def, ...sub, d, e} = tb
280 280
281do
282 for {:a, :b} in *items
283 print a, b
284
285 for :a, :b in *items
286 print a, b
287
288 for :body in pairs data
289 print body if body
290
281nil 291nil
282 292
diff --git a/spec/inputs/funcs.yue b/spec/inputs/funcs.yue
index 6b1669b..d19c2d1 100644
--- a/spec/inputs/funcs.yue
+++ b/spec/inputs/funcs.yue
@@ -98,7 +98,7 @@ f(
98 98
99x = (a, 99x = (a,
100 b) -> 100 b) ->
101 print "what" 101 print "what"
102 102
103 103
104y = (a="hi", 104y = (a="hi",
@@ -211,7 +211,7 @@ do
211 print "kv:", k, v 211 print "kv:", k, v
212 print "rest count:", select "#", ... 212 print "rest count:", select "#", ...
213 macro gen = (fname) -> | 213 macro gen = (fname) -> |
214 #{fname} = ({:a, :b = 0}) -> print a, b 214 #{fname} = ({:a, :b = 0}) -> print a, b
215 $gen foo 215 $gen foo
216 t1 = (:a, x) -> print a, x 216 t1 = (:a, x) -> print a, x
217 t2 = (:a) -> print a 217 t2 = (:a) -> print a
diff --git a/spec/inputs/string.yue b/spec/inputs/string.yue
index 1f0fba8..611205d 100644
--- a/spec/inputs/string.yue
+++ b/spec/inputs/string.yue
@@ -100,8 +100,8 @@ do
100 next: 123 100 next: 123
101 str = | 101 str = |
102 list: 102 list:
103 - "one" 103 - "one"
104 - "two" 104 - "two"
105 str = | 105 str = |
106 -- comment 106 -- comment
107 content text 107 content text
diff --git a/spec/inputs/unicode/funcs.yue b/spec/inputs/unicode/funcs.yue
index c563356..cb35500 100644
--- a/spec/inputs/unicode/funcs.yue
+++ b/spec/inputs/unicode/funcs.yue
@@ -98,7 +98,7 @@ _无效变量 = -> 真名 if 某物
98 98
99变量x = (参数a, 99变量x = (参数a,
100 参数b) -> 100 参数b) ->
101 打印 "什么" 101 打印 "什么"
102 102
103 103
104变量y = (参数a="hi", 104变量y = (参数a="hi",
diff --git a/spec/inputs/unicode/vararg.yue b/spec/inputs/unicode/vararg.yue
index e59e114..b508fbb 100644
--- a/spec/inputs/unicode/vararg.yue
+++ b/spec/inputs/unicode/vararg.yue
@@ -55,12 +55,12 @@
55 _ = -> 55 _ = ->
56 列表 = {1, 2, 3, 4, 5} 56 列表 = {1, 2, 3, 4, 5}
57 函数名 = (确定) -> 57 函数名 = (确定) ->
58 确定, table.unpack 列表 58 确定, table.unpack 列表
59 确定, ... = 函数名 true 59 确定, ... = 函数名 true
60 打印 确定, ... 60 打印 确定, ...
61 61
62 多参数函数 = -> 62 多参数函数 = ->
63 10, nil, 20, nil, 30 63 10, nil, 20, nil, 30
64 64
65 ... = 多参数函数! 65 ... = 多参数函数!
66 打印 select "#", ... 66 打印 select "#", ...
diff --git a/spec/inputs/vararg.yue b/spec/inputs/vararg.yue
index 941cd97..6100250 100644
--- a/spec/inputs/vararg.yue
+++ b/spec/inputs/vararg.yue
@@ -55,12 +55,12 @@ join = (...) ->
55 _ = -> 55 _ = ->
56 list = {1, 2, 3, 4, 5} 56 list = {1, 2, 3, 4, 5}
57 fn = (ok) -> 57 fn = (ok) ->
58 ok, table.unpack list 58 ok, table.unpack list
59 ok, ... = fn true 59 ok, ... = fn true
60 print ok, ... 60 print ok, ...
61 61
62 fn_many_args = -> 62 fn_many_args = ->
63 10, nil, 20, nil, 30 63 10, nil, 20, nil, 30
64 64
65 ... = fn_many_args! 65 ... = fn_many_args!
66 print select "#", ... 66 print select "#", ...
diff --git a/spec/inputs/with.yue b/spec/inputs/with.yue
index 2256833..19ed2a7 100644
--- a/spec/inputs/with.yue
+++ b/spec/inputs/with.yue
@@ -167,7 +167,7 @@ do
167 167
168do 168do
169 a = for i = 1, 100 169 a = for i = 1, 100
170 with? x := tb[i] 170 with? x := tb[i]
171 break x if .id := 1 171 break x if .id := 1
172 172
173nil 173nil