summaryrefslogtreecommitdiff
path: root/spec/inputs
diff options
context:
space:
mode:
Diffstat (limited to 'spec/inputs')
-rw-r--r--spec/inputs/macro-todo.yue13
-rw-r--r--spec/inputs/macro.yue15
2 files changed, 15 insertions, 13 deletions
diff --git a/spec/inputs/macro-todo.yue b/spec/inputs/macro-todo.yue
new file mode 100644
index 0000000..8477e5a
--- /dev/null
+++ b/spec/inputs/macro-todo.yue
@@ -0,0 +1,13 @@
1export macro todoInner = (module, line, msg)->
2 print "TODO#{msg and ': ' .. msg or ''} in file #{module}, at line #{line}"
3 {
4 code: "-- TODO#{msg and ': ' .. msg or ''}"
5 type: "lua"
6 }
7
8export macro todo = (msg)->
9 if msg
10 "$todoInner $MODULE, $LINE, #{msg}"
11 else
12 "$todoInner $MODULE, $LINE"
13
diff --git a/spec/inputs/macro.yue b/spec/inputs/macro.yue
index 366a3d9..2742bd0 100644
--- a/spec/inputs/macro.yue
+++ b/spec/inputs/macro.yue
@@ -6,6 +6,8 @@ import "macro-export" as {
6 $config:$myconfig, -- rename macro $config to $myconfig 6 $config:$myconfig, -- rename macro $config to $myconfig
7} 7}
8 8
9import "macro-todo" as $
10
9$asserts item == nil 11$asserts item == nil
10 12
11$myconfig false 13$myconfig false
@@ -258,19 +260,6 @@ print $tb[1], $tb.a, ($tb)!, $tb!
258 260
259print "current line: #{ $LINE }" 261print "current line: #{ $LINE }"
260 262
261macro todoInner = (module, line, msg)->
262 print "TODO#{msg and ': ' .. msg or ''} in file #{module}, at line #{line}"
263 {
264 code: "-- TODO#{msg and ': ' .. msg or ''}"
265 type: "lua"
266 }
267
268macro todo = (msg)->
269 if msg
270 "$todoInner $MODULE, $LINE, #{msg}"
271 else
272 "$todoInner $MODULE, $LINE"
273
274$todo 263$todo
275 264
276macro implicitReturnMacroIsAllowed = -> "print 'abc'\n123" 265macro implicitReturnMacroIsAllowed = -> "print 'abc'\n123"