support same-line doc comments in routines (#18595)

* support same-line comments in routines
* remove assert as per review comment
This commit is contained in:
Timothee Cour 2021-07-27 10:50:59 -07:00 • committed by GitHub
commit 8d2f6bba3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 205 additions and 1 deletions

View file

@ -31,6 +31,23 @@ proc someType*(): SomeType =
## constructor.
SomeType(2)
proc fn2*() = discard ## comment
proc fn3*(): auto = 1 ## comment
proc fn4*(): auto = 2 * 3 + 4 ## comment
proc fn5*() ## comment
proc fn5*() = discard
proc fn6*() =
## comment
proc fn7*() =
## comment
discard
proc fn8*(): auto =
## comment
1+1
func fn9*(a: int): int = 42 ## comment
func fn10*(a: int): int = a ## comment
# bug #9235
template aEnum*(): untyped =