mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #25027
(cherry picked from commit b8ce11dd9d)
This commit is contained in:
@@ -327,6 +327,10 @@ proc pushCom(g: var TSrcGen, n: PNode) =
|
||||
setLen(g.comStack, g.comStack.len + 1)
|
||||
g.comStack[^1] = n
|
||||
|
||||
proc popCom(g: var TSrcGen): PNode =
|
||||
result = g.comStack[^1]
|
||||
setLen(g.comStack, g.comStack.len - 1)
|
||||
|
||||
proc popAllComs(g: var TSrcGen) =
|
||||
setLen(g.comStack, 0)
|
||||
|
||||
@@ -1353,6 +1357,10 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext, fromStmtList = false) =
|
||||
if not n[0].isExported() and renderNonExportedFields notin g.flags:
|
||||
# Skip if this is a property in a type and its not exported
|
||||
# (While also not allowing rendering of non exported fields)
|
||||
if shouldRenderComment(g, n):
|
||||
# `shouldRenderComment` indicts that we have comments to render
|
||||
# but it's a non-exported field, so we just pop without rendering any comment
|
||||
discard popCom(g)
|
||||
return
|
||||
# render postfix for object fields:
|
||||
exclFlags = g.flags * {renderNoPostfix}
|
||||
|
||||
@@ -82,6 +82,9 @@
|
||||
Rectangle ## A four-sided shape">Shapes</a></li>
|
||||
<li><a class="reference" href="#T19396" title="T19396 = object
|
||||
a*: int">T19396</a></li>
|
||||
<li><a class="reference" href="#Xxx" title="Xxx = object
|
||||
field*: int
|
||||
field3*: int ## Doc comment2">Xxx</a></li>
|
||||
|
||||
</ul>
|
||||
</details>
|
||||
@@ -455,6 +458,16 @@
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
<div id="Xxx">
|
||||
<dt><pre><a href="testproject.html#Xxx"><span class="Identifier">Xxx</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
|
||||
<span class="Identifier">field</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
|
||||
<span class="Identifier">field3</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span> <span class="Comment">## Doc comment2</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ nim T19396 testproject.html#T19396 object T19396 404
|
||||
nim somePragma testproject.html#somePragma.t template somePragma() 408
|
||||
nim MyObject testproject.html#MyObject object MyObject 412
|
||||
nim AnotherObject testproject.html#AnotherObject object AnotherObject 417
|
||||
nim Xxx testproject.html#Xxx object Xxx 424
|
||||
nimgrp bar testproject.html#bar-procs-all proc 43
|
||||
nimgrp baz testproject.html#baz-procs-all proc 46
|
||||
heading Basic usage testproject.html#basic-usage Basic usage 0
|
||||
|
||||
@@ -342,6 +342,10 @@
|
||||
<li><a class="reference external"
|
||||
data-doc-search-tag="testproject: proc tripleStrLitTest()" href="testproject.html#tripleStrLitTest">testproject: proc tripleStrLitTest()</a></li>
|
||||
</ul></dd>
|
||||
<dt><a name="Xxx" href="#Xxx"><span>Xxx:</span></a></dt><dd><ul class="simple">
|
||||
<li><a class="reference external"
|
||||
data-doc-search-tag="testproject: object Xxx" href="testproject.html#Xxx">testproject: object Xxx</a></li>
|
||||
</ul></dd>
|
||||
<dt><a name="z1" href="#z1"><span>z1:</span></a></dt><dd><ul class="simple">
|
||||
<li><a class="reference external"
|
||||
data-doc-search-tag="testproject: proc z1(): Foo" href="testproject.html#z1">testproject: proc z1(): Foo</a></li>
|
||||
|
||||
@@ -420,3 +420,10 @@ type
|
||||
y*: proc (x: string)
|
||||
of false:
|
||||
hidden: string
|
||||
|
||||
type Xxx* = object
|
||||
field*: int
|
||||
field2: int
|
||||
## Doc comment
|
||||
field3*: int
|
||||
## Doc comment2
|
||||
|
||||
Reference in New Issue
Block a user