Fix docgen snippet numbering (#13507)

This commit is contained in:
genotrance 2020-03-03 13:52:16 -06:00 • committed by GitHub
commit f8175688a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -191,10 +191,10 @@ proc newDocumentor*(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef,
initStrTable result.types
result.onTestSnippet =
proc (gen: var RstGenerator; filename, cmd: string; status: int; content: string) =
inc(gen.id)
var d = TDocumentor(gen)
var outp: AbsoluteFile
if filename.len == 0:
inc(d.id)
let nameOnly = splitFile(d.filename).name
outp = getNimcacheDir(conf) / RelativeDir(nameOnly) /
RelativeFile(nameOnly & "_snippet_" & $d.id & ".nim")

View file

@ -49,7 +49,7 @@ when defined(nimlocks):
else:
{.pragma: benign, gcsafe.}
template since(version, body: untyped) {.dirty.} =
template since(version, body: untyped) {.dirty, used.} =
## limitation: can't be used to annotate a template (eg typetraits.get), would
## error: cannot attach a custom pragma.
when (NimMajor, NimMinor) >= version: