breaking change: getAst strips away pointless nnkStmtList nodes; node rendering of nnkStmtList without wrong indentation

This commit is contained in:
Andreas Rumpf 2017-09-26 10:24:14 +02:00
commit 61720e0df9
3 changed files with 13 additions and 5 deletions

View file

@ -1617,9 +1617,10 @@ proc semExpandToAst(c: PContext, n: PNode): PNode =
# Preserve the magic symbol in order to be handled in evals.nim
internalAssert n.sons[0].sym.magic == mExpandToAst
#n.typ = getSysSym("NimNode").typ # expandedSym.getReturnType
n.typ = if getCompilerProc("NimNode") != nil: sysTypeFromName"NimNode"
else: sysTypeFromName"PNimrodNode"
result = n
if n.kind == nkStmtList and n.len == 1: result = n[0]
else: result = n
result.typ = if getCompilerProc("NimNode") != nil: sysTypeFromName"NimNode"
else: sysTypeFromName"PNimrodNode"
proc semExpandToAst(c: PContext, n: PNode, magicSym: PSym,
flags: TExprFlags = {}): PNode =