mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 19:34:12 +00:00
added newTree to ast.nim
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user