Allow void macro result (#11286)

* allow void macro result
* add test for void macro result type
This commit is contained in:
Arne Döring 2019-05-21 21:31:40 +02:00 • committed by Andreas Rumpf
commit f94ec363ab
25 changed files with 143 additions and 60 deletions

View file

@ -18,7 +18,7 @@ proc initOpts(): set[nlOptions] =
const cOpts = initOpts()
macro nlo(): typed =
macro nlo() =
nlOpts.incl(nloNone)
nlOpts.excl(nloDebug)
result = newEmptyNode()

View file

@ -24,7 +24,7 @@ bb
const s = @[1,2,3]
macro foo: typed =
macro foo() =
for e in s:
echo e
@ -55,7 +55,7 @@ static:
var m2: TData = data
for x in m2.numbers: echo x
macro ff(d: static[TData]): typed =
macro ff(d: static[TData]) =
for x in d.letters:
echo x

View file

@ -20,7 +20,7 @@ nimout: '''
#bug #2514
macro foo(): typed =
macro foo() =
var x = 8'u8
var y = 9'u16
var z = 17'u32
@ -58,7 +58,7 @@ macro foo(): typed =
var zz = 0x7FFFFFFF'u32
echo zz
macro foo2(): typed =
macro foo2() =
var xx = 0x7FFFFFFFFFFFFFFF
echo xx