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

@ -95,12 +95,8 @@
## runForever()
##
include "system/inclrtl"
import asyncdispatch
import nativesockets
import net
import os
import std/private/since
import asyncdispatch, nativesockets, net, os
export SOBool

View file

@ -12,8 +12,9 @@
##
## Unstable API.
import std/private/since
import strutils
include "system/inclrtl"
when defined(windows):
import winlean

View file

@ -12,7 +12,7 @@
## by Adam Langley.
## (A crit bit tree is a form of `radix tree`:idx: or `patricia trie`:idx:.)
include "system/inclrtl"
import std/private/since
type
NodeObj[T] {.acyclic.} = object

View file

@ -51,7 +51,7 @@
## * `lists module <lists.html>`_ for singly and doubly linked lists and rings
## * `channels module <channels.html>`_ for inter-thread communication
include system/inclrtl
import std/private/since
import math

View file

@ -73,7 +73,7 @@
## heterogeneous members
include "system/inclrtl"
import std/private/since
import macros

View file

@ -217,9 +217,9 @@
## * `hashes module<hashes.html>`_ for helper functions for hashing
import hashes, math, algorithm
import std/private/since
include "system/inclrtl"
import hashes, math, algorithm
type
KeyValuePair[A, B] = tuple[hcode: Hash, key: A, val: B]

View file

@ -44,7 +44,7 @@
## * `std/sha1 module <sha1.html>`_ for a sha1 encoder and decoder
## * `tables module <tables.html>`_ for hash tables
include "system/inclrtl"
import std/private/since
type
Hash* = int ## A hash value. Hash tables using these values should

View file

@ -200,7 +200,7 @@
## let client = newHttpClient(maxRedirects = 0)
##
include "system/inclrtl"
import std/private/since
import net, strutils, uri, parseutils, base64, os, mimetypes, streams,
math, random, httpcore, times, tables, streams, std/monotimes

View file

@ -52,7 +52,7 @@
## are on system directly, to name a few ``shr``, ``shl``, ``xor``, ``clamp``, etc.
include "system/inclrtl"
import std/private/since
{.push debugger: off.} # the user does not want to trace a part
# of the standard library!

View file

@ -64,7 +64,7 @@
## socket.acceptAddr(client, address)
## echo("Client connected from: ", address)
include "system/inclrtl"
import std/private/since
import nativesockets, os, strutils, times, sets, options, std/monotimes
from ssl_certs import scanSSLCertificates

View file

@ -42,6 +42,7 @@
## * `streams module <streams.html>`_
include "system/inclrtl"
import std/private/since
import
strutils, pathnorm

View file

@ -94,7 +94,7 @@
## * `asyncstreams module <asyncstreams.html>`_
## * `io module <io.html>`_ for `FileMode enum <io.html#FileMode>`_
include "system/inclrtl"
import std/private/since
const taintMode = compileOption("taintmode")

View file

@ -48,6 +48,7 @@ runnableExamples:
## * `json module<json.html>`_ for table-like structure which allows
## heterogeneous members
import std/private/since
import
hashes, strutils

View file

@ -10,8 +10,7 @@
## This module implements nice syntactic sugar based on Nim's
## macro system.
include system/inclrtl
import std/private/since
import macros
import typetraits

View file

@ -194,6 +194,7 @@
import strutils, math, options
import std/private/since
include "system/inclrtl"
when defined(js):
@ -980,7 +981,7 @@ proc low*(typ: typedesc[Time]): Time =
# DateTime & Timezone
#
proc isLeapDay*(t: DateTime): bool {.since: (1,1).} =
proc isLeapDay*(t: DateTime): bool {.since: (1, 1).} =
## returns whether `t` is a leap day, ie, Feb 29 in a leap year. This matters
## as it affects time offset calculations.
runnableExamples:

View file

@ -12,10 +12,9 @@
##
## Unstable API.
import std/private/since
export system.`$` # for backward compatibility
include "system/inclrtl"
proc name*(t: typedesc): string {.magic: "TypeTrait".}
## Returns the name of the given type.
##
@ -79,15 +78,13 @@ since (1, 1):
doAssert 12.MyInt.distinctBase == 12
distinctBase(type(a))(a)
proc tupleLen*(T: typedesc[tuple]): int {.magic: "TypeTrait", since: (1, 1).}
## Return number of elements of `T`
proc tupleLen*(T: typedesc[tuple]): int {.magic: "TypeTrait".}
## Return number of elements of `T`
since (1, 1):
template tupleLen*(t: tuple): int =
## Return number of elements of `t`
tupleLen(type(t))
since (1, 1):
template get*(T: typedesc[tuple], i: static int): untyped =
## Return `i`\th element of `T`
# Note: `[]` currently gives: `Error: no generic parameters allowed for ...`

View file

@ -93,11 +93,11 @@
##
## echo "suite teardown: run once after the tests"
import std/private/since
import
macros, strutils, streams, times, sets, sequtils
include "system/inclrtl"
when declared(stdout):
import os

View file

@ -44,7 +44,7 @@
## doAssert getDataUri("Hello World", "text/plain") == "data:text/plain;charset=utf-8;base64,SGVsbG8gV29ybGQ="
## doAssert getDataUri("Nim", "text/plain") == "data:text/plain;charset=utf-8;base64,Tmlt"
include "system/inclrtl"
import std/private/since
import strutils, parseutils, base64
type

View file

@ -34,8 +34,8 @@
## * `parsexml module <parsexml.html>`_ for low-level XML parsing
## * `htmlgen module <htmlgen.html>`_ for html code generator
import std/private/since
import macros, strtabs, strutils
include "system/inclrtl"
type
XmlNode* = ref XmlNodeObj ## An XML tree consisting of XML nodes.
@ -103,7 +103,7 @@ proc newText*(text: string): XmlNode =
result = newXmlNode(xnText)
result.fText = text
proc newVerbatimText*(text: string): XmlNode {.since:(1, 3).} =
proc newVerbatimText*(text: string): XmlNode {.since: (1, 3).} =
## Creates a new ``XmlNode`` of kind ``xnVerbatimText`` with the text `text`.
## **Since**: Version 1.3.
result = newXmlNode(xnVerbatimText)