Improved documentation for macros.newProc.

This commit is contained in:
Dominik Picheta 2013-07-28 14:41:54 +01:00
commit ec86d5db0f

View file

@ -480,6 +480,9 @@ proc ExpectKind*(n: PNimrodNode; k: set[TNimrodNodeKind]) {.compileTime.} =
proc newProc*(name = newEmptyNode(); params: openarray[PNimrodNode] = []; proc newProc*(name = newEmptyNode(); params: openarray[PNimrodNode] = [];
body: PNimrodNode = newStmtList(), procType = nnkProcDef): PNimrodNode {.compileTime.} = body: PNimrodNode = newStmtList(), procType = nnkProcDef): PNimrodNode {.compileTime.} =
## shortcut for creating a new proc ## shortcut for creating a new proc
##
## The ``params`` array should start with the return type of the proc,
## followed by a list of IdentDefs which specify the params.
assert procType in RoutineNodes assert procType in RoutineNodes
result = newNimNode(procType).add( result = newNimNode(procType).add(
name, name,