diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/inputs/macro.yue | 9 | ||||
-rw-r--r-- | spec/outputs/macro.lua | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/inputs/macro.yue b/spec/inputs/macro.yue index 5dafd84..5d5f1a9 100644 --- a/spec/inputs/macro.yue +++ b/spec/inputs/macro.yue | |||
@@ -340,6 +340,15 @@ _1 = -> | |||
340 | print 2 | 340 | print 2 |
341 | print 3 | 341 | print 3 |
342 | 342 | ||
343 | do | ||
344 | macro foo = -> code: "tb:func(123)", type: "lua" | ||
345 | f = -> | ||
346 | x = $foo\bar 456 | ||
347 | $foo! | ||
348 | f1 = -> | ||
349 | $foo! | ||
350 | return | ||
351 | |||
343 | macro implicitReturnMacroIsAllowed = -> "print 'abc'\n123" | 352 | macro implicitReturnMacroIsAllowed = -> "print 'abc'\n123" |
344 | 353 | ||
345 | $implicitReturnMacroIsAllowed | 354 | $implicitReturnMacroIsAllowed |
diff --git a/spec/outputs/macro.lua b/spec/outputs/macro.lua index 83c6a90..7163077 100644 --- a/spec/outputs/macro.lua +++ b/spec/outputs/macro.lua | |||
@@ -330,6 +330,17 @@ _1 = function() | |||
330 | return _accum_0 | 330 | return _accum_0 |
331 | end | 331 | end |
332 | do | 332 | do |
333 | f = function() | ||
334 | x = (tb:func(123)):bar(456) | ||
335 | return (tb:func(123)) | ||
336 | end | ||
337 | local f1 | ||
338 | f1 = function() | ||
339 | tb:func(123) | ||
340 | return | ||
341 | end | ||
342 | end | ||
343 | do | ||
333 | print('abc') | 344 | print('abc') |
334 | return 123 | 345 | return 123 |
335 | end | 346 | end |