This commit is contained in:
Timothee Cour 2019-08-15 22:19:34 -07:00 • committed by Andreas Rumpf
commit 922e2a5098

View file

@ -608,7 +608,7 @@ proc expectLen*(n: NimNode, min, max: int) {.compileTime.} =
## If this is not the case, compilation aborts with an error message. ## If this is not the case, compilation aborts with an error message.
## This is useful for writing macros that check its number of arguments. ## This is useful for writing macros that check its number of arguments.
if n.len < min or n.len > max: if n.len < min or n.len > max:
error("macro expects a node with " & $min & ".." & $max " children", n) error("macro expects a node with " & $min & ".." & $max & " children", n)
proc newTree*(kind: NimNodeKind, proc newTree*(kind: NimNodeKind,
children: varargs[NimNode]): NimNode {.compileTime.} = children: varargs[NimNode]): NimNode {.compileTime.} =