Fix #55 - crash and no typedef name

This commit is contained in:
Ganesh Viswanathan 2019-01-21 12:37:51 -06:00
commit a8028a62ec
3 changed files with 10 additions and 5 deletions

View file

@ -11,14 +11,14 @@ proc printLisp(root: TSNode) =
depth = 0
while true:
if not node.tsNodeIsNull():
if not node.tsNodeIsNull() and depth > -1:
if gStateRT.pretty:
stdout.write spaces(depth)
let
(line, col) = node.getLineCol()
stdout.write &"({$node.tsNodeType()} {line} {col} {node.tsNodeEndByte() - node.tsNodeStartByte()}"
else:
return
break
if node.tsNodeNamedChildCount() != 0:
if gStateRT.pretty: