Remove unnecessary proc

This commit is contained in:
Joey Yakimowich-Payne 2020-04-25 20:47:28 -06:00 committed by genotrance
commit 4f1464bdfb

View file

@ -1,4 +1,4 @@
import dynlib, macros, os, sequtils, sets, strformat, strutils, tables, times, options
import dynlib, macros, os, sequtils, sets, strformat, strutils, tables, times
import algorithm
import regex
@ -644,15 +644,6 @@ proc getCommentsStr*(gState: State, commentNodes: seq[TSNode]): string =
for commentNode in commentNodes:
result &= "\n " & gState.getNodeVal(commentNode).replace(re" *(//|/\*\*|\*\*/|/\*|\*/|\*)", "").replace("\n", "\n ").strip()
template findComment(procName: untyped): untyped =
var sibling = node.`procName`()
var i = 0
while not sibling.isNil and i < maxSearch:
if sibling.getName() == "comment":
return some(sibling)
sibling = sibling.`procName`()
i += 1
proc getPrevCommentNodes*(node: TSNode, maxSearch=1): seq[TSNode] =
## Here we want to go until the node we get is not a comment
## for cases with multiple ``//`` comments instead of one ``/* */``