summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ast.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index e073ce3e1..8054e9248 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