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:
parent
4a436120bd
commit
b72480ec88
4 changed files with 76 additions and 42 deletions
|
|
@ -341,7 +341,7 @@ type
|
|||
TMagic* = enum # symbols that require compiler magic:
|
||||
mNone, mDefined, mDefinedInScope, mLow, mHigh, mSizeOf, mIs, mOf,
|
||||
mEcho, mShallowCopy, mSlurp,
|
||||
mAstToYaml, mParseExprToAst, mParseStmtToAst, mExpandToAst,
|
||||
mParseExprToAst, mParseStmtToAst, mExpandToAst,
|
||||
mUnaryLt, mSucc,
|
||||
mPred, mInc, mDec, mOrd, mNew, mNewFinalize, mNewSeq, mLengthOpenArray,
|
||||
mLengthStr, mLengthArray, mLengthSeq, mIncl, mExcl, mCard, mChr, mGCref,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue