Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docgen snippet numbering #13507

Merged
merged 1 commit into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/docgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion lib/system/inclrtl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down