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

@ -567,7 +567,7 @@ proc quote*(bl: typed, op = "``"): NimNode {.magic: "QuoteAst", noSideEffect.}
##
## .. code-block:: nim
##
## macro check(ex: untyped): typed =
## macro check(ex: untyped) =
## # this is a simplified version of the check macro from the
## # unittest module.
##

View file

@ -572,7 +572,7 @@ when not useUnicode:
proc isTitle(a: char): bool {.inline.} = return false
proc isWhiteSpace(a: char): bool {.inline.} = return a in {' ', '\9'..'\13'}
template matchOrParse(mopProc: untyped): typed =
template matchOrParse(mopProc: untyped) =
# Used to make the main matcher proc *rawMatch* as well as event parser
# procs. For the former, *enter* and *leave* event handler code generators
# are provided which just return *discard*.

View file

@ -71,7 +71,7 @@ template onFailedAssert*(msg, code: untyped): untyped {.dirty.} =
let msg = msgIMPL
code
template doAssertRaises*(exception: typedesc, code: untyped): typed =
template doAssertRaises*(exception: typedesc, code: untyped) =
## Raises ``AssertionError`` if specified ``code`` does not raise the
## specified exception. Example:
##