From f5ee979fa8238b9d165e7c46b4c715581ce032ed Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Fri, 24 Apr 2020 23:41:56 -0600 Subject: Fix comments not being valid rst --- nimterop/getters.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nimterop/getters.nim b/nimterop/getters.nim index 5ad9e4e..ed2cf73 100644 --- a/nimterop/getters.nim +++ b/nimterop/getters.nim @@ -639,7 +639,7 @@ proc getNameKind*(name: string): tuple[name: string, kind: Kind, recursive: bool proc getCommentVal*(gState: State, commentNode: Option[TSNode]): string = if commentNode.isSome(): - result = gState.getNodeVal(commentNode.get()).replace(re" *(/\*\*|\*\*/|\*/|\*)", "").strip() + result = "::\n " & gState.getNodeVal(commentNode.get()).replace(re" *(/\*\*|\*\*/|\*/|\*)", "").replace("\n", "\n ").strip() template findComment(procName: untyped): untyped = result = none(TSNode) @@ -651,10 +651,10 @@ template findComment(procName: untyped): untyped = sibling = sibling.`procName`() i += 1 -proc getPrevCommentNode*(node: TSNode, maxSearch=4): Option[TSNode] = +proc getPrevCommentNode*(node: TSNode, maxSearch=1): Option[TSNode] = findComment(tsNodePrevNamedSibling) -proc getNextCommentNode*(node: TSNode, maxSearch=4): Option[TSNode] = +proc getNextCommentNode*(node: TSNode, maxSearch=1): Option[TSNode] = findComment(tsNodeNextNamedSibling) proc getTSNodeNamedChildNames*(node: TSNode): seq[string] = -- cgit v1.2.3