diff options
author | genotrance <dev@genotrance.com> | 2020-03-03 13:52:16 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-03 20:52:16 +0100 |
commit | f8175688a3b9c88b53685a35a454aeba4b2bcc5d (patch) | |
tree | af5e699947ee81f2dc64ef3259808377d7180840 | |
parent | e8c057fb2729b2598b8cb62ae46f85139fb480fa (diff) | |
download | Nim-f8175688a3b9c88b53685a35a454aeba4b2bcc5d.tar.gz |
Fix docgen snippet numbering (#13507)
-rw-r--r-- | compiler/docgen.nim | 2 | ||||
-rw-r--r-- | lib/system/inclrtl.nim | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim index daa3a708d..6c98266b5 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -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") diff --git a/lib/system/inclrtl.nim b/lib/system/inclrtl.nim index adbda9fd6..e84794c74 100644 --- a/lib/system/inclrtl.nim +++ b/lib/system/inclrtl.nim @@ -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: |