aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2018-12-03 21:15:02 -0600
committerGanesh Viswanathan <dev@genotrance.com>2018-12-03 21:15:02 -0600
commitd3340d51e2d15a93fef46e4cf5be67ac69413cd9 (patch)
tree7689340e3861ed873eb82de4c84eb80d60f6bd50
parent007f3aa1913dca798f73ee55ca9cbe507b36fef6 (diff)
downloadnimterop-d3340d51e2d15a93fef46e4cf5be67ac69413cd9.tar.gz
nimterop-d3340d51e2d15a93fef46e4cf5be67ac69413cd9.zip
Fix inline comments breaking search
-rw-r--r--nimterop/ast.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/nimterop/ast.nim b/nimterop/ast.nim
index ca4a563..1f397c1 100644
--- a/nimterop/ast.nim
+++ b/nimterop/ast.nim
@@ -42,6 +42,7 @@ proc searchAstForNode(ast: ref Ast, node: TSNode): bool =
if ast.isNil:
return
+
if ast.children.len != 0:
let
rstr = ast.getRegexForAstChildren()
@@ -50,7 +51,7 @@ proc searchAstForNode(ast: ref Ast, node: TSNode): bool =
if node.getTSNodeNamedChildCountSansComments() != 0:
var flag = true
for i in 0 .. node.tsNodeNamedChildCount()-1:
- if node.tsNodeType() != "comment":
+ if $node.tsNodeNamedChild(i).tsNodeType() != "comment":
let
nodeChild = node.tsNodeNamedChild(i)
astChild = ast.getAstChildByName($nodeChild.tsNodeType())