new kind of AST printer that prints indented trees

AST-to-string conversion procs renamed to repr, treeRepr and lispRepr for better consistency
new dumpTree and dumpLisp procs for quick AST inspection of arbitrary nimrod blocks
This commit is contained in:
Zahary Karadjov 2011-11-04 04:56:40 +02:00
commit b72480ec88
4 changed files with 76 additions and 42 deletions

View file

@ -1118,9 +1118,6 @@ proc evalMagicOrCall(c: PEvalContext, n: PNode): PNode =
result = evalAux(c, n.sons[1], {})
if isSpecial(result): return
result = newStrNodeT(result.info.toFileLineCol, n)
of mAstToYaml:
var ast = evalAux(c, n.sons[1], {efLValue})
result = newStrNode(nkStrLit, ast.treeToYaml.ropeToStr)
of mNHint:
result = evalAux(c, n.sons[1], {})
if isSpecial(result): return