added newTree to ast.nim
This commit is contained in:
parent
e9313dd362
commit
81f876040b
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue