From 81f876040b3f301eff1cc49fcc3812c040086664 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 10 Nov 2015 15:29:01 +0100 Subject: [PATCH] added newTree to ast.nim --- compiler/ast.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/ast.nim b/compiler/ast.nim index e073ce3e1b..8054e9248c 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -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