Thanks for the help. I didn't quite get what the not unused error was because
it was so short and I was hung up on the other error.
This works:
macro t2(): untyped =
result = getAst(t1())
#t2()
Run
A macro produces an abstract syntax tree (AST) of nodes, that's what is
assigned to its `result` variable. A macro call like `t1()` is replaced with
the code representation of this AST,
This works.
import macros
import typetraits
macro t1() : untyped =
return nnkStmtList.newTree(
nnkDiscardStmt.newTree(
newEmptyNode()
)
)
t1()
Run
But if I add:
macro t2(): untyped =