diff --git a/nimterop/getters.nim b/nimterop/getters.nim index 1bb3efa..42cb28b 100644 --- a/nimterop/getters.nim +++ b/nimterop/getters.nim @@ -453,8 +453,8 @@ template decho*(str: untyped): untyped = proc printDebug*(nimState: NimState, node: TSNode) = if nimState.gState.debug: - echo ("Input => " & nimState.getNodeVal(node)).getCommented() - echo nimState.gState.printLisp(node).getCommented() + necho ("Input => " & nimState.getNodeVal(node)).getCommented() & "\n" & + nimState.gState.printLisp(node).getCommented() proc printDebug*(nimState: NimState, pnode: PNode) = if nimState.gState.debug: diff --git a/nimterop/globals.nim b/nimterop/globals.nim index be24436..7dd6fe7 100644 --- a/nimterop/globals.nim +++ b/nimterop/globals.nim @@ -96,3 +96,7 @@ when not declared(CIMPORT): template necho*(args: string) {.dirty.} = let gState = nimState.gState gecho args + + template decho*(str: untyped): untyped = + if nimState.gState.debug: + necho str.getCommented()