macro myMacroThatDoesStuff(...) = ... macro getAstAsStr(body: typed): untyped = newLit body.repr writeFile("path", getAstAsStr(myMacroThatDoesStuff(...))