fix #8871 runnableExamples now preserves source code comments, litterals, and all formatting; other bug fix (#14439)
* fix #8871 runnableExamples now preserves source code comments, litterals, and all formatting * remove orig deadcode from getAllRunnableExamplesImpl * fix expected examples * add test to close https://github.com/nim-lang/Nim/issues/14473 * correctly handle regular comments before 1st token inside runnableExamples * add test to answer https://github.com/nim-lang/Nim/pull/14439#discussion_r431829199 * update tests
This commit is contained in:
parent
17d08ff71c
commit
e013ebc91a
12 changed files with 927 additions and 76 deletions
|
|
@ -21,6 +21,8 @@ More text.
|
|||
|
||||
]##
|
||||
|
||||
# BUG: module link in theindex.html is wrong, see #14434
|
||||
|
||||
type
|
||||
SomeType* = enum
|
||||
enumValueA,
|
||||
|
|
@ -48,3 +50,23 @@ template bEnum*(): untyped =
|
|||
## Stuff in `quotes` here.
|
||||
## [Some link](https://nim-lang.org)
|
||||
discard
|
||||
|
||||
template fromUtilsGen*(): untyped =
|
||||
## this should be shown in utils.html
|
||||
runnableExamples:
|
||||
assert 3*2 == 6
|
||||
## ditto
|
||||
|
||||
iterator fromUtils1*(): int =
|
||||
runnableExamples:
|
||||
# ok1
|
||||
assert 1 == 1
|
||||
# ok2
|
||||
yield 15
|
||||
|
||||
template fromUtils2*() =
|
||||
## ok3
|
||||
|
||||
proc fromUtils3*() =
|
||||
## came form utils but should be shown where `fromUtilsGen` is called
|
||||
runnableExamples: discard 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue