Added codeRepr and dumpCode to the macros module. (#5778)

This commit is contained in:
PMunch 2017-07-26 00:37:37 +02:00 • committed by Andreas Rumpf
commit e00953cbc0
2 changed files with 126 additions and 4 deletions

View file

@ -0,0 +1,25 @@
discard """
msg: '''nnkStmtList.newTree(
nnkVarSection.newTree(
nnkIdentDefs.newTree(
newIdentNode(!"x"),
newEmptyNode(),
nnkCall.newTree(
nnkDotExpr.newTree(
newIdentNode(!"foo"),
newIdentNode(!"create")
),
newLit(56)
)
)
)
)'''
"""
# disabled; can't work as the output is done by the compiler
import macros
dumpAstGen:
var x = foo.create(56)