Fix inline comments breaking search

This commit is contained in:
Ganesh Viswanathan 2018-12-03 21:15:02 -06:00
commit d3340d51e2

View file

@ -42,6 +42,7 @@ proc searchAstForNode(ast: ref Ast, node: TSNode): bool =
if ast.isNil: if ast.isNil:
return return
if ast.children.len != 0: if ast.children.len != 0:
let let
rstr = ast.getRegexForAstChildren() rstr = ast.getRegexForAstChildren()
@ -50,7 +51,7 @@ proc searchAstForNode(ast: ref Ast, node: TSNode): bool =
if node.getTSNodeNamedChildCountSansComments() != 0: if node.getTSNodeNamedChildCountSansComments() != 0:
var flag = true var flag = true
for i in 0 .. node.tsNodeNamedChildCount()-1: for i in 0 .. node.tsNodeNamedChildCount()-1:
if node.tsNodeType() != "comment": if $node.tsNodeNamedChild(i).tsNodeType() != "comment":
let let
nodeChild = node.tsNodeNamedChild(i) nodeChild = node.tsNodeNamedChild(i)
astChild = ast.getAstChildByName($nodeChild.tsNodeType()) astChild = ast.getAstChildByName($nodeChild.tsNodeType())