From c87587a068837c1475722bc4005a4022f61fdd2e Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Wed, 15 Jan 2020 16:48:45 -0600 Subject: [PATCH] Fix bug --- nimterop/getters.nim | 4 ++-- nimterop/globals.nim | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) 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()