Added codeRepr and dumpCode to the macros module. (#5778)
This commit is contained in:
parent
ce341982a6
commit
e00953cbc0
2 changed files with 126 additions and 4 deletions
25
tests/macros/tdumpastgen.nim
Normal file
25
tests/macros/tdumpastgen.nim
Normal 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)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue