added newTree to ast.nim

This commit is contained in:
Araq
2015-11-10 15:29:01 +01:00
parent e9313dd362
commit 81f876040b

View File

@@ -1013,6 +1013,10 @@ proc newNode*(kind: TNodeKind): PNode =
writeStackTrace()
inc gNodeId
proc newTree*(kind: TNodeKind; children: varargs[PNode]): PNode =
result = newNode(kind)
result.sons = @children
proc newIntNode*(kind: TNodeKind, intVal: BiggestInt): PNode =
result = newNode(kind)
result.intVal = intVal