From d3340d51e2d15a93fef46e4cf5be67ac69413cd9 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Mon, 3 Dec 2018 21:15:02 -0600 Subject: Fix inline comments breaking search --- nimterop/ast.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()) -- cgit v1.2.3