diff options
author | Li Jin <dragon-fly@qq.com> | 2021-11-23 09:34:46 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-11-23 09:34:57 +0800 |
commit | 65050db97932197ce990f36fc0efed8d0c1298a2 (patch) | |
tree | c3b8d0d941438cb6bd308b0d4ce08ecf389da821 /spec/inputs | |
parent | 825b5d96f8a0d146615f0c6a76feab46da9baa60 (diff) | |
download | yuescript-65050db97932197ce990f36fc0efed8d0c1298a2.tar.gz yuescript-65050db97932197ce990f36fc0efed8d0c1298a2.tar.bz2 yuescript-65050db97932197ce990f36fc0efed8d0c1298a2.zip |
fix an indent issue. add more macro specs. fixing issue #69.
Diffstat (limited to 'spec/inputs')
-rw-r--r-- | spec/inputs/macro-todo.yue | 4 | ||||
-rw-r--r-- | spec/inputs/macro.yue | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/spec/inputs/macro-todo.yue b/spec/inputs/macro-todo.yue index 8477e5a..752c9cb 100644 --- a/spec/inputs/macro-todo.yue +++ b/spec/inputs/macro-todo.yue | |||
@@ -7,7 +7,7 @@ export macro todoInner = (module, line, msg)-> | |||
7 | 7 | ||
8 | export macro todo = (msg)-> | 8 | export macro todo = (msg)-> |
9 | if msg | 9 | if msg |
10 | "$todoInner $MODULE, $LINE, #{msg}" | 10 | "$todoInner $FILE, $LINE, #{msg}" |
11 | else | 11 | else |
12 | "$todoInner $MODULE, $LINE" | 12 | "$todoInner $FILE, $LINE" |
13 | 13 | ||
diff --git a/spec/inputs/macro.yue b/spec/inputs/macro.yue index 2742bd0..37702d1 100644 --- a/spec/inputs/macro.yue +++ b/spec/inputs/macro.yue | |||
@@ -262,6 +262,22 @@ print "current line: #{ $LINE }" | |||
262 | 262 | ||
263 | $todo | 263 | $todo |
264 | 264 | ||
265 | macro skip = -> "" | ||
266 | |||
267 | do | ||
268 | print 1 | ||
269 | <- $skip | ||
270 | print 2 | ||
271 | print 3 | ||
272 | |||
273 | macro skip = -> "while false do break" | ||
274 | |||
275 | _ = -> | ||
276 | print 1 | ||
277 | <- $skip | ||
278 | print 2 | ||
279 | print 3 | ||
280 | |||
265 | macro implicitReturnMacroIsAllowed = -> "print 'abc'\n123" | 281 | macro implicitReturnMacroIsAllowed = -> "print 'abc'\n123" |
266 | 282 | ||
267 | $implicitReturnMacroIsAllowed | 283 | $implicitReturnMacroIsAllowed |