mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-28 02:03:59 +00:00
fix #17615(runnableExamples silently ignored if placed after some code) (#17619)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
@@ -1016,7 +1016,9 @@ cz15
|
||||
<p><strong class="examples_text">Example:</strong></p>
|
||||
<pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="DecNumber">4</span></pre>ok5 ok5b
|
||||
<p><strong class="examples_text">Example:</strong></p>
|
||||
<pre class="listing"><span class="Identifier">assert</span><span class="Whitespace"> </span><span class="Identifier">true</span></pre>in or out?
|
||||
<pre class="listing"><span class="Identifier">assert</span><span class="Whitespace"> </span><span class="Identifier">true</span></pre>
|
||||
<p><strong class="examples_text">Example:</strong></p>
|
||||
<pre class="listing"><span class="Keyword">discard</span><span class="Whitespace"> </span><span class="DecNumber">1</span></pre>in or out?
|
||||
|
||||
</dd>
|
||||
<a id="testNimDocTrailingExample.t"></a>
|
||||
|
||||
@@ -330,13 +330,11 @@ when true: # (most) templates
|
||||
## ok5
|
||||
## ok5b
|
||||
runnableExamples: assert true
|
||||
runnableExamples: discard 1
|
||||
|
||||
## in or out?
|
||||
# this is an edge case; a newline separate last runnableExamples from
|
||||
# next doc comment but AST isnt' aware of it; this could change in future
|
||||
discard 8
|
||||
## out
|
||||
runnableExamples: discard 1
|
||||
|
||||
when true: # issue #14473
|
||||
import std/[sequtils]
|
||||
|
||||
Reference in New Issue
Block a user