Skip to content

Commit

Permalink
use renderNoPostfix everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Dec 22, 2023
1 parent 30ef941 commit 8acb12c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
13 changes: 7 additions & 6 deletions compiler/docgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ proc toLangSymbol(k: TSymKind, n: PNode, baseName: string): LangSymbol =
if genNode != nil:
var literal = ""
var r: TSrcGen = initTokRender(genNode, {renderNoBody, renderNoComments,
renderNoPragmas, renderNoProcDefs, renderExpandUsing})
renderNoPragmas, renderNoProcDefs, renderExpandUsing, renderNoPostfix})
var kind = tkEof
while true:
getNextTok(r, kind, literal)
Expand Down Expand Up @@ -1099,10 +1099,10 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind, docFlags: DocFlags, nonEx
priority = symbolPriority(k), info = lineinfo,
module = addRstFileIndex(d, FileIndex d.module.position))

let renderFlags =
if nonExports: {renderNoBody, renderNoComments, renderDocComments, renderSyms,
renderExpandUsing, renderNonExportedFields}
else: {renderNoBody, renderNoComments, renderDocComments, renderSyms, renderExpandUsing}
var renderFlags = {renderNoBody, renderNoComments, renderDocComments,
renderSyms, renderExpandUsing, renderNoPostfix}
if nonExports:
renderFlags.incl renderNonExportedFields
nodeToHighlightedHtml(d, n, result, renderFlags, symbolOrIdEnc)

let seeSrc = genSeeSrc(d, toFullPath(d.conf, n.info), n.info.line.int)
Expand Down Expand Up @@ -1167,7 +1167,8 @@ proc genJsonItem(d: PDoc, n, nameNode: PNode, k: TSymKind, nonExports = false):
name = getNameEsc(d, nameNode)
comm = genRecComment(d, n)
r: TSrcGen
renderFlags = {renderNoBody, renderNoComments, renderDocComments, renderExpandUsing}
renderFlags = {renderNoBody, renderNoComments, renderDocComments,
renderExpandUsing, renderNoPostfix}
if nonExports:
renderFlags.incl renderNonExportedFields
r = initTokRender(n, renderFlags)
Expand Down
2 changes: 1 addition & 1 deletion nimdoc/extlinks/project/expected/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ <h1><a class="toc-backref" href="#6">Imports</a></h1>
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="A">
<dt><pre><a href="main.html#A"><span class="Identifier">A</span></a><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">object</span>
<dt><pre><a href="main.html#A"><span class="Identifier">A</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
</pre></dt>
<dd>

Expand Down
2 changes: 1 addition & 1 deletion nimdoc/extlinks/project/expected/sub/submodule.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h1 class="title">nimdoc/extlinks/project/sub/submodule</h1>
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="submoduleInt">
<dt><pre><a href="submodule.html#submoduleInt"><span class="Identifier">submoduleInt</span></a><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">distinct</span> <span class="Identifier">int</span></pre></dt>
<dt><pre><a href="submodule.html#submoduleInt"><span class="Identifier">submoduleInt</span></a> <span class="Other">=</span> <span class="Keyword">distinct</span> <span class="Identifier">int</span></pre></dt>
<dd>


Expand Down
4 changes: 2 additions & 2 deletions nimdoc/testproject/expected/subdir/subdir_b/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ <h2><a class="toc-backref" id="pandoc-markdown-symbols-documentation" href="#pan
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="G">
<dt><pre><a href="utils.html#G"><span class="Identifier">G</span></a><span class="Operator">*</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">object</span>
<dt><pre><a href="utils.html#G"><span class="Identifier">G</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">object</span>
</pre></dt>
<dd>

Expand All @@ -262,7 +262,7 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
</dd>
</div>
<div id="SomeType">
<dt><pre><a href="utils.html#SomeType"><span class="Identifier">SomeType</span></a><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">enum</span>
<dt><pre><a href="utils.html#SomeType"><span class="Identifier">SomeType</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">enumValueA</span><span class="Other">,</span> <span class="Identifier">enumValueB</span><span class="Other">,</span> <span class="Identifier">enumValueC</span></pre></dt>
<dd>

Expand Down
26 changes: 13 additions & 13 deletions nimdoc/testproject/expected/testproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ <h1><a class="toc-backref" href="#6">Imports</a></h1>
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="A">
<dt><pre><a href="testproject.html#A"><span class="Identifier">A</span></a><span class="Operator">*</span> {.<span class="Identifier">inject</span>.} <span class="Other">=</span> <span class="Keyword">enum</span>
<dt><pre><a href="testproject.html#A"><span class="Identifier">A</span></a> {.<span class="Identifier">inject</span>.} <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">aA</span></pre></dt>
<dd>

Expand All @@ -377,10 +377,10 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
</dd>
</div>
<div id="AnotherObject">
<dt><pre><a href="testproject.html#AnotherObject"><span class="Identifier">AnotherObject</span></a><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Keyword">case</span> <span class="Identifier">x</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">bool</span>
<dt><pre><a href="testproject.html#AnotherObject"><span class="Identifier">AnotherObject</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Keyword">case</span> <span class="Identifier">x</span><span class="Other">:</span> <span class="Identifier">bool</span>
<span class="Keyword">of</span> <span class="Identifier">true</span><span class="Other">:</span>
<span class="Identifier">y</span><span class="Operator">*</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span>
<span class="Identifier">y</span><span class="Other">:</span> <span class="Keyword">proc</span> <span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span>

<span class="Keyword">of</span> <span class="Identifier">false</span><span class="Other">:</span>

Expand All @@ -392,7 +392,7 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
</dd>
</div>
<div id="B">
<dt><pre><a href="testproject.html#B"><span class="Identifier">B</span></a><span class="Operator">*</span> {.<span class="Identifier">inject</span>.} <span class="Other">=</span> <span class="Keyword">enum</span>
<dt><pre><a href="testproject.html#B"><span class="Identifier">B</span></a> {.<span class="Identifier">inject</span>.} <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">bB</span></pre></dt>
<dd>

Expand All @@ -401,7 +401,7 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
</dd>
</div>
<div id="Foo">
<dt><pre><a href="testproject.html#Foo"><span class="Identifier">Foo</span></a><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">enum</span>
<dt><pre><a href="testproject.html#Foo"><span class="Identifier">Foo</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">enumValueA2</span></pre></dt>
<dd>

Expand All @@ -410,7 +410,7 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
</dd>
</div>
<div id="FooBuzz">
<dt><pre><a href="testproject.html#FooBuzz"><span class="Identifier">FooBuzz</span></a><span class="Operator">*</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;FooBuzz msg&quot;</span></span>.} <span class="Other">=</span> <span class="Identifier">int</span></pre></dt>
<dt><pre><a href="testproject.html#FooBuzz"><span class="Identifier">FooBuzz</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;FooBuzz msg&quot;</span></span>.} <span class="Other">=</span> <span class="Identifier">int</span></pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> FooBuzz msg
Expand All @@ -421,9 +421,9 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
</dd>
</div>
<div id="MyObject">
<dt><pre><a href="testproject.html#MyObject"><span class="Identifier">MyObject</span></a><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">someString</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## This is a string</span>
<span class="Identifier">annotated</span><span class="Operator">*</span> {.<span class="Identifier">somePragma</span>.}<span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## This is an annotated string</span>
<dt><pre><a href="testproject.html#MyObject"><span class="Identifier">MyObject</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">someString</span><span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## This is a string</span>
<span class="Identifier">annotated</span> {.<span class="Identifier">somePragma</span>.}<span class="Other">:</span> <span class="Identifier">string</span> <span class="Comment">## This is an annotated string</span>
</pre></dt>
<dd>

Expand All @@ -432,7 +432,7 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
</dd>
</div>
<div id="Shapes">
<dt><pre><a href="testproject.html#Shapes"><span class="Identifier">Shapes</span></a><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">enum</span>
<dt><pre><a href="testproject.html#Shapes"><span class="Identifier">Shapes</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">Circle</span><span class="Other">,</span> <span class="Comment">## A circle</span>
<span class="Identifier">Triangle</span><span class="Other">,</span> <span class="Comment">## A three-sided shape</span>
<span class="Identifier">Rectangle</span> <span class="Comment">## A four-sided shape</span></pre></dt>
Expand All @@ -443,8 +443,8 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
</dd>
</div>
<div id="T19396">
<dt><pre><a href="testproject.html#T19396"><span class="Identifier">T19396</span></a><span class="Operator">*</span> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">a</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span>
<dt><pre><a href="testproject.html#T19396"><span class="Identifier">T19396</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">a</span><span class="Other">:</span> <span class="Identifier">int</span>
</pre></dt>
<dd>

Expand Down

0 comments on commit 8acb12c

Please sign in to comment.