diff options
| author | Joey Yakimowich-Payne <jyapayne@gmail.com> | 2020-04-24 23:41:56 -0600 |
|---|---|---|
| committer | genotrance <dev@genotrance.com> | 2020-05-04 16:43:07 -0500 |
| commit | f5ee979fa8238b9d165e7c46b4c715581ce032ed (patch) | |
| tree | d9ce6102e18599ef4b37008768adc493cce6940a | |
| parent | 5a4432bb683bc23909e575a28b1bce35b826a0ab (diff) | |
| download | nimterop-f5ee979fa8238b9d165e7c46b4c715581ce032ed.tar.gz nimterop-f5ee979fa8238b9d165e7c46b4c715581ce032ed.zip | |
Fix comments not being valid rst
| -rw-r--r-- | nimterop/getters.nim | 6 |
1 files 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] = |
