diff options
Diffstat (limited to 'compiler/ast.nim')
-rw-r--r-- | compiler/ast.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 64b59a283..565bb4353 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1560,3 +1560,9 @@ proc isEmptyType*(t: PType): bool {.inline.} = ## 'void' and 'stmt' types are often equivalent to 'nil' these days: result = t == nil or t.kind in {tyEmpty, tyStmt} +proc makeStmtList*(n: PNode): PNode = + if n.kind == nkStmtList: + result = n + else: + result = newNodeI(nkStmtList, n.info) + result.add n |