diff options
author | Li Jin <dragon-fly@qq.com> | 2022-04-24 11:26:46 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-04-24 11:26:46 +0800 |
commit | fe6d146bc4454d8096ddd0543d7142db3da5da5b (patch) | |
tree | dcdc4d08a8934b1b306e60f9f802ff11f22ce22b /spec/inputs | |
parent | 84b93d0e43e7248fd00df6957d55a954c48628d7 (diff) | |
download | yuescript-fe6d146bc4454d8096ddd0543d7142db3da5da5b.tar.gz yuescript-fe6d146bc4454d8096ddd0543d7142db3da5da5b.tar.bz2 yuescript-fe6d146bc4454d8096ddd0543d7142db3da5da5b.zip |
fix spreading syntax behavior.
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/tables.yue | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/inputs/tables.yue b/spec/inputs/tables.yue index 4cd9b4d..649c1dc 100644 --- a/spec/inputs/tables.yue +++ b/spec/inputs/tables.yue | |||
@@ -237,5 +237,30 @@ menus = | |||
237 | click: -> | 237 | click: -> |
238 | } | 238 | } |
239 | 239 | ||
240 | tb = {...other} | ||
241 | |||
242 | tbMix = { | ||
243 | 1, 2, 3 | ||
244 | ... with item | ||
245 | .x = 1 | ||
246 | \func! | ||
247 | "a", "b", "c" | ||
248 | ...func?! | ||
249 | key: "value" | ||
250 | ... -- perform the Lua table behavior here | ||
251 | } | ||
252 | |||
253 | tbMixA = { | ||
254 | ...[i for i = 1, 10] | ||
255 | 11 | ||
256 | } | ||
257 | |||
258 | tbMixB = { | ||
259 | ... ... -- only the first item in vararg been accessed here | ||
260 | ... {...} | ||
261 | ... {......} | ||
262 | 1, 2, 3 | ||
263 | } | ||
264 | |||
240 | nil | 265 | nil |
241 | 266 | ||