summaryrefslogtreecommitdiff
path: root/spec/inputs/macro-export.yue
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-02-17 11:22:07 +0800
committerLi Jin <dragon-fly@qq.com>2021-02-17 11:22:07 +0800
commit7066392d1c974065181d95d93274136dcd625d43 (patch)
treecf51eafc2c52cbc12246a306bca172d799193d30 /spec/inputs/macro-export.yue
parent90cd12ad9ef465f3e435e1bd034dcfbe4e19d016 (diff)
downloadyuescript-7066392d1c974065181d95d93274136dcd625d43.tar.gz
yuescript-7066392d1c974065181d95d93274136dcd625d43.tar.bz2
yuescript-7066392d1c974065181d95d93274136dcd625d43.zip
stop reusing variables, rename project.
Diffstat (limited to 'spec/inputs/macro-export.yue')
-rw-r--r--spec/inputs/macro-export.yue29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/inputs/macro-export.yue b/spec/inputs/macro-export.yue
new file mode 100644
index 0000000..d669975
--- /dev/null
+++ b/spec/inputs/macro-export.yue
@@ -0,0 +1,29 @@
1export macro config = (debugging = true)->
2 global debugMode = debugging == "true"
3 global debugMacro = true
4 ""
5
6export macro showMacro = (name,res)->
7 if debugMacro
8 "do
9 txt = #{res}
10 print '[macro '..#{name}..']'
11 print txt
12 txt"
13 else
14 res
15
16export macro asserts = (cond)->
17 if debugMode
18 $showMacro "assert", "assert #{cond}"
19 else
20 ""
21
22export macro assert = (cond)->
23 if debugMode
24 $showMacro "assert", "assert #{cond}"
25 else
26 "#{cond}"
27
28$config!
29