move since from inclrtl to std/private/since (#14188)

* move since from inclrtl to std/private/since
* move since import in system below for HCR
This commit is contained in:
hlaaftana 2020-05-03 00:51:59 +03:00 • committed by GitHub
commit fbc97e712a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 60 additions and 59 deletions

View file

@ -48,21 +48,3 @@ when defined(nimlocks):
{.pragma: benign, gcsafe, locks: 0.}
else:
{.pragma: benign, gcsafe.}
template isSince(version: (int, int)): bool =
(NimMajor, NimMinor) >= version
template isSince(version: (int, int, int)): bool =
(NimMajor, NimMinor, NimPatch) >= version
template since(version, body: untyped) {.dirty, used.} =
## Usage:
##
## .. code-block:: Nim
## proc fun*() {since: (1, 3).}
## proc fun*() {since: (1, 3, 1).}
##
## Limitation: can't be used to annotate a template (eg typetraits.get), would
## error: cannot attach a custom pragma.
# `dirty` needed because `NimMajor` may not yet be defined in caller.
when isSince(version):
body