aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2020-01-16 12:49:37 -0600
committerGanesh Viswanathan <dev@genotrance.com>2020-01-16 12:49:37 -0600
commit5241aee0fcb1a6a75b38ef1a73ed9b0f9113f2d7 (patch)
tree927825003d2c500370ea3295957bf67d182220af
parentc87587a068837c1475722bc4005a4022f61fdd2e (diff)
downloadnimterop-5241aee0fcb1a6a75b38ef1a73ed9b0f9113f2d7.tar.gz
nimterop-5241aee0fcb1a6a75b38ef1a73ed9b0f9113f2d7.zip
Merge PR#166 from master
-rw-r--r--nimterop/ast2.nim8
-rw-r--r--nimterop/getters.nim8
-rw-r--r--nimterop/toast.nim2
3 files changed, 7 insertions, 11 deletions
diff --git a/nimterop/ast2.nim b/nimterop/ast2.nim
index 810beea..e6f3a63 100644
--- a/nimterop/ast2.nim
+++ b/nimterop/ast2.nim
@@ -1,6 +1,6 @@
import macros, os, strutils, tables, times
-import compiler/[ast, astalgo, idents, options, renderer]
+import compiler/[ast, idents, options, renderer]
import "."/treesitter/api
@@ -806,8 +806,8 @@ proc searchTree(nimState: NimState, root: TSNode) =
if node == root:
break
-proc printNimHeader*() =
- echo """# Generated at $1
+proc printNimHeader*(gState: State) =
+ gecho """# Generated at $1
# Command line:
# $2 $3
@@ -845,4 +845,4 @@ proc printNim*(gState: State, fullpath: string, root: TSNode) =
tree.add nimState.typeSection
tree.add nimState.procSection
- echo tree.renderTree()
+ gecho tree.renderTree()
diff --git a/nimterop/getters.nim b/nimterop/getters.nim
index 42cb28b..be58a48 100644
--- a/nimterop/getters.nim
+++ b/nimterop/getters.nim
@@ -445,11 +445,7 @@ proc printTree*(nimState: NimState, pnode: PNode, offset = "") =
else:
stdout.write ")"
if offset.len == 0:
- echo ""
-
-template decho*(str: untyped): untyped =
- if nimState.gState.debug:
- echo str.getCommented()
+ necho ""
proc printDebug*(nimState: NimState, node: TSNode) =
if nimState.gState.debug:
@@ -458,7 +454,7 @@ proc printDebug*(nimState: NimState, node: TSNode) =
proc printDebug*(nimState: NimState, pnode: PNode) =
if nimState.gState.debug:
- echo ("Output => " & $pnode).getCommented()
+ necho ("Output => " & $pnode).getCommented()
nimState.printTree(pnode)
# Compiler shortcuts
diff --git a/nimterop/toast.nim b/nimterop/toast.nim
index 08f0dbb..3761d3e 100644
--- a/nimterop/toast.nim
+++ b/nimterop/toast.nim
@@ -42,7 +42,7 @@ proc process(gState: State, path: string) =
tree.tsTreeDelete()
if gState.past:
- echo gState.printLisp(root)
+ gecho gState.printLisp(root)
elif gState.pnim:
gState.printNim(path, root)
elif gState.preprocess: