AST change: keep nkStaticStmt in the AST for incremental compilation support

This commit is contained in:
Andreas Rumpf 2018-06-03 20:16:29 +02:00
commit 9ab92824f6
4 changed files with 9 additions and 6 deletions

View file

@ -863,7 +863,7 @@ proc transform(c: PTransf, n: PNode): PTransNode =
# ensure that e.g. discard "some comment" gets optimized away
# completely:
result = PTransNode(newNode(nkCommentStmt))
of nkCommentStmt, nkTemplateDef:
of nkCommentStmt, nkTemplateDef, nkImportStmt, nkStaticStmt:
return n.PTransNode
of nkConstSection:
# do not replace ``const c = 3`` with ``const 3 = 3``