aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/macro_export.mp
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs/macro_export.mp')
-rw-r--r--spec/inputs/macro_export.mp29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/inputs/macro_export.mp b/spec/inputs/macro_export.mp
new file mode 100644
index 0000000..759c6d1
--- /dev/null
+++ b/spec/inputs/macro_export.mp
@@ -0,0 +1,29 @@
1export macro block config = (debugging = true)->
2 global debugMode = debugging == "true"
3 global debugMacro = true
4 ""
5
6export macro expr 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 block asserts = (cond)->
17 if debugMode
18 $showMacro "assert", "assert #{cond}"
19 else
20 ""
21
22export macro expr assert = (cond)->
23 if debugMode
24 $showMacro "assert", "assert #{cond}"
25 else
26 "#{cond}"
27
28$config!
29