diff options
Diffstat (limited to 'lib')
38 files changed, 109 insertions, 1 deletions
diff --git a/lib/core/typeinfo.nim b/lib/core/typeinfo.nim index 18d2091b9..df2e66226 100644 --- a/lib/core/typeinfo.nim +++ b/lib/core/typeinfo.nim @@ -40,6 +40,10 @@ include "system/hti.nim" {.pop.} +when defined(nimPreviewSlimSystem): + import std/assertions + + type AnyKind* = enum ## The kind of `Any`. akNone = 0, ## invalid diff --git a/lib/experimental/diff.nim b/lib/experimental/diff.nim index ea0a5cfb8..4ca5eb319 100644 --- a/lib/experimental/diff.nim +++ b/lib/experimental/diff.nim @@ -45,6 +45,9 @@ jkl""" import tables, strutils +when defined(nimPreviewSlimSystem): + import std/assertions + type Item* = object ## An Item in the list of differences. startA*: int ## Start Line number in Data A. diff --git a/lib/impure/db_sqlite.nim b/lib/impure/db_sqlite.nim index f79e87f1b..5e648d097 100644 --- a/lib/impure/db_sqlite.nim +++ b/lib/impure/db_sqlite.nim @@ -172,6 +172,8 @@ import db_common export db_common import std/private/[since, dbutils] +when defined(nimPreviewSlimSystem): + import std/assertions type DbConn* = PSqlite3 ## Encapsulates a database connection. diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim index 738fc39cf..e9dd49df0 100644 --- a/lib/impure/nre.nim +++ b/lib/impure/nre.nim @@ -66,6 +66,9 @@ from strutils import `%` import options from unicode import runeLenAt +when defined(nimPreviewSlimSystem): + import std/assertions + export options type diff --git a/lib/impure/re.nim b/lib/impure/re.nim index 4eacf0091..8b9de0c68 100644 --- a/lib/impure/re.nim +++ b/lib/impure/re.nim @@ -34,6 +34,9 @@ runnableExamples: import pcre, strutils, rtarrays +when defined(nimPreviewSlimSystem): + import std/syncio + const MaxSubpatterns* = 20 ## defines the maximum number of subpatterns that can be captured. diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim index ed786cefb..92ad9c5ff 100644 --- a/lib/pure/asyncdispatch.nim +++ b/lib/pure/asyncdispatch.nim @@ -232,6 +232,9 @@ import asyncfutures except callSoon import nativesockets, net, deques +when defined(nimPreviewSlimSystem): + import std/[assertions, syncio] + export Port, SocketFlag export asyncfutures except callSoon export asyncstreams diff --git a/lib/pure/asyncfile.nim b/lib/pure/asyncfile.nim index 222a89b97..9cc9f5b48 100644 --- a/lib/pure/asyncfile.nim +++ b/lib/pure/asyncfile.nim @@ -24,6 +24,9 @@ import asyncdispatch, os +when defined(nimPreviewSlimSystem): + import std/[assertions, syncio] + # TODO: Fix duplication introduced by PR #4683. when defined(windows) or defined(nimdoc): diff --git a/lib/pure/asyncftpclient.nim b/lib/pure/asyncftpclient.nim index 056d65564..0d2ee80c5 100644 --- a/lib/pure/asyncftpclient.nim +++ b/lib/pure/asyncftpclient.nim @@ -81,6 +81,9 @@ import asyncdispatch, asyncnet, nativesockets, strutils, parseutils, os, times from net import BufferSize +when defined(nimPreviewSlimSystem): + import std/assertions + type AsyncFtpClient* = ref object csock*: AsyncSocket diff --git a/lib/pure/asyncfutures.nim b/lib/pure/asyncfutures.nim index e91b99c3a..035b6182d 100644 --- a/lib/pure/asyncfutures.nim +++ b/lib/pure/asyncfutures.nim @@ -13,6 +13,7 @@ import system/stacktraces when defined(nimPreviewSlimSystem): import std/objectdollar # for StackTraceEntry + import std/assertions # TODO: This shouldn't need to be included, but should ideally be exported. type diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim index ac51d768d..6694c4bc2 100644 --- a/lib/pure/asynchttpserver.nim +++ b/lib/pure/asynchttpserver.nim @@ -44,6 +44,9 @@ import httpcore from nativesockets import getLocalAddr, Domain, AF_INET, AF_INET6 import std/private/since +when defined(nimPreviewSlimSystem): + import std/assertions + export httpcore except parseHeader const diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim index cd02e5df5..b61eaa902 100644 --- a/lib/pure/asyncnet.nim +++ b/lib/pure/asyncnet.nim @@ -96,6 +96,10 @@ ## import std/private/since + +when defined(nimPreviewSlimSystem): + import std/[assertions, syncio] + import asyncdispatch, nativesockets, net, os export SOBool diff --git a/lib/pure/asyncstreams.nim b/lib/pure/asyncstreams.nim index 083c6f0ea..3f7774ed8 100644 --- a/lib/pure/asyncstreams.nim +++ b/lib/pure/asyncstreams.nim @@ -11,6 +11,9 @@ import asyncfutures +when defined(nimPreviewSlimSystem): + import std/assertions + import deques type diff --git a/lib/pure/cgi.nim b/lib/pure/cgi.nim index 566482b21..0ab8f4c95 100644 --- a/lib/pure/cgi.nim +++ b/lib/pure/cgi.nim @@ -32,6 +32,9 @@ import strutils, os, strtabs, cookies, uri export uri.encodeUrl, uri.decodeUrl +when defined(nimPreviewSlimSystem): + import std/syncio + proc addXmlChar(dest: var string, c: char) {.inline.} = case c diff --git a/lib/pure/collections/critbits.nim b/lib/pure/collections/critbits.nim index dca60b37b..24257dacb 100644 --- a/lib/pure/collections/critbits.nim +++ b/lib/pure/collections/critbits.nim @@ -36,6 +36,9 @@ runnableExamples: import std/private/since +when defined(nimPreviewSlimSystem): + import std/assertions + type NodeObj[T] {.acyclic.} = object byte: int ## byte index of the difference diff --git a/lib/pure/concurrency/cpuload.nim b/lib/pure/concurrency/cpuload.nim index 841d58d86..137dd67ad 100644 --- a/lib/pure/concurrency/cpuload.nim +++ b/lib/pure/concurrency/cpuload.nim @@ -19,6 +19,9 @@ when defined(windows): elif defined(linux): from cpuinfo import countProcessors +when defined(nimPreviewSlimSystem): + import std/syncio + type ThreadPoolAdvice* = enum doNothing, diff --git a/lib/pure/concurrency/threadpool.nim b/lib/pure/concurrency/threadpool.nim index 9334b4833..5d9e7452b 100644 --- a/lib/pure/concurrency/threadpool.nim +++ b/lib/pure/concurrency/threadpool.nim @@ -23,6 +23,9 @@ when not compileOption("threads"): import cpuinfo, cpuload, locks, os +when defined(nimPreviewSlimSystem): + import std/assertions + {.push stackTrace:off.} type diff --git a/lib/pure/cookies.nim b/lib/pure/cookies.nim index 0306558d6..22704e434 100644 --- a/lib/pure/cookies.nim +++ b/lib/pure/cookies.nim @@ -11,6 +11,9 @@ import strtabs, times, options +when defined(nimPreviewSlimSystem): + import std/assertions + type SameSite* {.pure.} = enum ## The SameSite cookie attribute. diff --git a/lib/pure/encodings.nim b/lib/pure/encodings.nim index 36e891dd3..26b6e1f22 100644 --- a/lib/pure/encodings.nim +++ b/lib/pure/encodings.nim @@ -40,6 +40,8 @@ runnableExamples: import os +when defined(nimPreviewSlimSystem): + import std/assertions when not defined(windows): type diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 405fadc2f..5c7f538b5 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -237,6 +237,9 @@ import std/[ asyncnet, asyncdispatch, asyncfile, nativesockets, ] +when defined(nimPreviewSlimSystem): + import std/[assertions, syncio] + export httpcore except parseHeader # TODO: The `except` doesn't work type diff --git a/lib/pure/marshal.nim b/lib/pure/marshal.nim index 06a21976b..848d7e3fb 100644 --- a/lib/pure/marshal.nim +++ b/lib/pure/marshal.nim @@ -56,6 +56,9 @@ Please contribute a new implementation.""".} import streams, typeinfo, json, intsets, tables, unicode +when defined(nimPreviewSlimSystem): + import std/[assertions, formatfloat] + proc ptrToInt(x: pointer): int {.inline.} = result = cast[int](x) # don't skip alignment diff --git a/lib/pure/memfiles.nim b/lib/pure/memfiles.nim index dacb15e17..28563b6fe 100644 --- a/lib/pure/memfiles.nim +++ b/lib/pure/memfiles.nim @@ -24,6 +24,10 @@ else: import os, streams +when defined(nimPreviewSlimSystem): + import std/[syncio, assertions] + + proc newEIO(msg: string): ref IOError = new(result) result.msg = msg diff --git a/lib/pure/mimetypes.nim b/lib/pure/mimetypes.nim index d1566d897..346fb39ee 100644 --- a/lib/pure/mimetypes.nim +++ b/lib/pure/mimetypes.nim @@ -29,6 +29,10 @@ runnableExamples: import tables from strutils import startsWith, toLowerAscii, strip +when defined(nimPreviewSlimSystem): + import std/assertions + + type MimeDB* = object mimes: OrderedTable[string, string] diff --git a/lib/pure/nativesockets.nim b/lib/pure/nativesockets.nim index ca4e61621..dcba996a4 100644 --- a/lib/pure/nativesockets.nim +++ b/lib/pure/nativesockets.nim @@ -16,6 +16,8 @@ import os, options import std/private/since import std/strbasics +when defined(nimPreviewSlimSystem): + import std/[assertions, syncio] when hostOS == "solaris": {.passl: "-lsocket -lnsl".} diff --git a/lib/pure/net.nim b/lib/pure/net.nim index 9ed73e723..16390d9af 100644 --- a/lib/pure/net.nim +++ b/lib/pure/net.nim @@ -90,6 +90,9 @@ runnableExamples("-r:off"): import std/private/since +when defined(nimPreviewSlimSystem): + import std/assertions + import nativesockets import os, strutils, times, sets, options, std/monotimes import ssl_config diff --git a/lib/pure/parsesql.nim b/lib/pure/parsesql.nim index 61196aead..3af840e29 100644 --- a/lib/pure/parsesql.nim +++ b/lib/pure/parsesql.nim @@ -15,6 +15,9 @@ import strutils, lexbase import std/private/decode_helpers +when defined(nimPreviewSlimSystem): + import std/assertions + # ------------------- scanner ------------------------------------------------- type diff --git a/lib/pure/parsexml.nim b/lib/pure/parsexml.nim index 79a9cc730..3ba5a19d5 100644 --- a/lib/pure/parsexml.nim +++ b/lib/pure/parsexml.nim @@ -149,6 +149,9 @@ an HTML document contains. import strutils, lexbase, streams, unicode +when defined(nimPreviewSlimSystem): + import std/assertions + # the parser treats ``<br />`` as ``<br></br>`` # xmlElementCloseEnd, ## ``/>`` diff --git a/lib/pure/random.nim b/lib/pure/random.nim index 8ce23b948..de93f468f 100644 --- a/lib/pure/random.nim +++ b/lib/pure/random.nim @@ -75,6 +75,9 @@ runnableExamples: import algorithm, math import std/private/since +when defined(nimPreviewSlimSystem): + import std/assertions + include system/inclrtl {.push debugger: off.} diff --git a/lib/pure/rationals.nim b/lib/pure/rationals.nim index 800979cda..aba0f4ce4 100644 --- a/lib/pure/rationals.nim +++ b/lib/pure/rationals.nim @@ -22,6 +22,8 @@ runnableExamples: doAssert r1 / r2 == -2 // 3 import math, hashes +when defined(nimPreviewSlimSystem): + import std/assertions type Rational*[T] = object ## A rational number, consisting of a numerator `num` and a denominator `den`. diff --git a/lib/pure/ropes.nim b/lib/pure/ropes.nim index 84b5b47c2..b973fd222 100644 --- a/lib/pure/ropes.nim +++ b/lib/pure/ropes.nim @@ -20,7 +20,7 @@ include system/inclrtl import streams when defined(nimPreviewSlimSystem): - import std/syncio + import std/[syncio, formatfloat, assertions] {.push debugger: off.} # the user does not want to trace a part # of the standard library! diff --git a/lib/pure/selectors.nim b/lib/pure/selectors.nim index 313702370..ab7e104fc 100644 --- a/lib/pure/selectors.nim +++ b/lib/pure/selectors.nim @@ -29,6 +29,9 @@ import os, nativesockets +when defined(nimPreviewSlimSystem): + import std/assertions + const hasThreadSupport = compileOption("threads") and defined(threadsafe) const ioselSupportedPlatform* = defined(macosx) or defined(freebsd) or diff --git a/lib/pure/stats.nim b/lib/pure/stats.nim index 58014e503..7f797529d 100644 --- a/lib/pure/stats.nim +++ b/lib/pure/stats.nim @@ -55,6 +55,9 @@ runnableExamples: from math import FloatClass, sqrt, pow, round +when defined(nimPreviewSlimSystem): + import std/[assertions, formatfloat] + {.push debugger: off.} # the user does not want to trace a part # of the standard library! {.push checks: off, line_dir: off, stack_trace: off.} diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index ec8058c1a..593bc1ca4 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -108,6 +108,9 @@ import std/private/since import std/exitprocs +when defined(nimPreviewSlimSystem): + import std/assertions + import macros, strutils, streams, times, sets, sequtils when declared(stdout): diff --git a/lib/std/jsbigints.nim b/lib/std/jsbigints.nim index 27df8fdad..04578fc87 100644 --- a/lib/std/jsbigints.nim +++ b/lib/std/jsbigints.nim @@ -3,6 +3,9 @@ when not defined(js): {.fatal: "Module jsbigints is designed to be used with the JavaScript backend.".} +when defined(nimPreviewSlimSystem): + import std/assertions + type JsBigIntImpl {.importjs: "bigint".} = int # https://github.com/nim-lang/Nim/pull/16606 type JsBigInt* = distinct JsBigIntImpl ## Arbitrary precision integer for JavaScript target. diff --git a/lib/std/sysrand.nim b/lib/std/sysrand.nim index 4ee25d01e..ff62c920b 100644 --- a/lib/std/sysrand.nim +++ b/lib/std/sysrand.nim @@ -62,6 +62,9 @@ when not defined(js): when defined(posix): import posix +when defined(nimPreviewSlimSystem): + import std/assertions + const batchImplOS = defined(freebsd) or defined(openbsd) or defined(zephyr) or (defined(macosx) and not defined(ios)) batchSize {.used.} = 256 diff --git a/lib/std/tasks.nim b/lib/std/tasks.nim index 7b931ab14..ac35e26bf 100644 --- a/lib/std/tasks.nim +++ b/lib/std/tasks.nim @@ -13,6 +13,9 @@ import std/[macros, isolation, typetraits] import system/ansi_c +when defined(nimPreviewSlimSystem): + import std/assertions + export isolation diff --git a/lib/std/tempfiles.nim b/lib/std/tempfiles.nim index ce84c2a37..ee42f8a5c 100644 --- a/lib/std/tempfiles.nim +++ b/lib/std/tempfiles.nim @@ -19,6 +19,8 @@ See also: import os, random +when defined(nimPreviewSlimSystem): + import std/syncio const maxRetry = 10000 diff --git a/lib/system/reprjs.nim b/lib/system/reprjs.nim index f5a0ed3ea..0818f9cc9 100644 --- a/lib/system/reprjs.nim +++ b/lib/system/reprjs.nim @@ -8,6 +8,9 @@ # # The generic ``repr`` procedure for the javascript backend. +when defined(nimPreviewSlimSystem): + import std/formatfloat + proc reprInt(x: int64): string {.compilerproc.} = $x proc reprFloat(x: float): string {.compilerproc.} = $x diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim index e049ac9d2..70fed664e 100644 --- a/lib/wrappers/openssl.nim +++ b/lib/wrappers/openssl.nim @@ -25,6 +25,9 @@ # from strutils import startsWith +when defined(nimPreviewSlimSystem): + import std/syncio + when defined(nimHasStyleChecks): {.push styleChecks: off.} |