aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/macro.yue
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-07-07 16:22:17 +0800
committerLi Jin <dragon-fly@qq.com>2022-07-07 16:22:17 +0800
commit1eb9ed57de854aa996614b7016bac04a68105389 (patch)
tree27b46d4a5482ac0ab542d18548c0691aa8115d93 /spec/inputs/macro.yue
parentb26b0c3e7061cd629500994e26fa162ac2668373 (diff)
downloadyuescript-1eb9ed57de854aa996614b7016bac04a68105389.tar.gz
yuescript-1eb9ed57de854aa996614b7016bac04a68105389.tar.bz2
yuescript-1eb9ed57de854aa996614b7016bac04a68105389.zip
add spec.
Diffstat (limited to 'spec/inputs/macro.yue')
-rw-r--r--spec/inputs/macro.yue10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/inputs/macro.yue b/spec/inputs/macro.yue
index e391b9e..e4b0fc8 100644
--- a/spec/inputs/macro.yue
+++ b/spec/inputs/macro.yue
@@ -24,6 +24,16 @@ if $and f1!
24if $and f1!, f2!, f3! 24if $and f1!, f2!, f3!
25 print "OK" 25 print "OK"
26 26
27item = $copy(
28 @
29 {pos: {}, flags: flags::tonumber!}
30 id
31 connections
32 pos.x
33 pos.y
34 pos.z
35)
36
27macro in = (target, ...)-> 37macro in = (target, ...)->
28 values = [value for value in *{...}] 38 values = [value for value in *{...}]
29 $showMacro "in", table.concat ["#{target} == #{item}" for item in *values], " or " 39 $showMacro "in", table.concat ["#{target} == #{item}" for item in *values], " or "