summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2022-03-24 03:34:53 +0800
committerGitHub <noreply@github.com>2022-03-23 20:34:53 +0100
commit7f6e800cafc7b73625893fb5280eb8b51a15b252 (patch)
tree90c7c75dd3056a2940182b3e6ca4c8c192bbb15b /lib/pure
parenta8b5ad845c4218b4f20595df097c593acee53d50 (diff)
downloadNim-7f6e800cafc7b73625893fb5280eb8b51a15b252.tar.gz
move assertions out of system (#19599)
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/algorithm.nim4
-rw-r--r--lib/pure/browsers.nim3
-rw-r--r--lib/pure/collections/hashcommon.nim4
-rw-r--r--lib/pure/collections/sequtils.nim4
-rw-r--r--lib/pure/hashes.nim4
-rw-r--r--lib/pure/json.nim2
-rw-r--r--lib/pure/lexbase.nim3
-rw-r--r--lib/pure/math.nim4
-rw-r--r--lib/pure/options.nim4
-rw-r--r--lib/pure/os.nim2
-rw-r--r--lib/pure/osproc.nim4
-rw-r--r--lib/pure/parsejson.nim3
-rw-r--r--lib/pure/streamwrapper.nim4
-rw-r--r--lib/pure/strformat.nim4
-rw-r--r--lib/pure/strtabs.nim4
-rw-r--r--lib/pure/strutils.nim3
-rw-r--r--lib/pure/terminal.nim2
-rw-r--r--lib/pure/times.nim4
-rw-r--r--lib/pure/typetraits.nim4
19 files changed, 63 insertions, 3 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim
index 1ddcc9843..c43545f78 100644
--- a/lib/pure/algorithm.nim
+++ b/lib/pure/algorithm.nim
@@ -44,6 +44,10 @@ runnableExamples:
 
 import std/private/since
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 type
   SortOrder* = enum
     Descending, Ascending
diff --git a/lib/pure/browsers.nim b/lib/pure/browsers.nim
index 08f5208d2..c36e31b11 100644
--- a/lib/pure/browsers.nim
+++ b/lib/pure/browsers.nim
@@ -16,6 +16,9 @@ import std/private/since
 
 import strutils
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
 when defined(windows):
   import winlean
   from os import absolutePath
diff --git a/lib/pure/collections/hashcommon.nim b/lib/pure/collections/hashcommon.nim
index a169418ce..deff8fa21 100644
--- a/lib/pure/collections/hashcommon.nim
+++ b/lib/pure/collections/hashcommon.nim
@@ -10,6 +10,10 @@
 # An `include` file which contains common code for
 # hash sets and tables.
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 const
   growthFactor = 2
 
diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim
index 64a7be7a9..5e9b492c2 100644
--- a/lib/pure/collections/sequtils.nim
+++ b/lib/pure/collections/sequtils.nim
@@ -84,6 +84,10 @@ import std/private/since
 
 import macros
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 when defined(nimHasEffectsOf):
   {.experimental: "strictEffects".}
 else:
diff --git a/lib/pure/hashes.nim b/lib/pure/hashes.nim
index 47dacec7d..e88210757 100644
--- a/lib/pure/hashes.nim
+++ b/lib/pure/hashes.nim
@@ -67,6 +67,10 @@ runnableExamples:
 
 import std/private/since
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 type
   Hash* = int ## A hash value. Hash tables using these values should
               ## always have a size of a power of two so they can use the `and`
diff --git a/lib/pure/json.nim b/lib/pure/json.nim
index bdc9fe5ab..dd9232ea6 100644
--- a/lib/pure/json.nim
+++ b/lib/pure/json.nim
@@ -165,7 +165,7 @@ import options # xxx remove this dependency using same approach as https://githu
 import std/private/since
 
 when defined(nimPreviewSlimSystem):
-  import std/syncio
+  import std/[syncio, assertions]
 
 export
   tables.`$`
diff --git a/lib/pure/lexbase.nim b/lib/pure/lexbase.nim
index bbc0a38ae..336a57ec1 100644
--- a/lib/pure/lexbase.nim
+++ b/lib/pure/lexbase.nim
@@ -14,6 +14,9 @@
 import
   strutils, streams
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
 const
   EndOfFile* = '\0' ## end of file marker
   NewLines* = {'\c', '\L'}
diff --git a/lib/pure/math.nim b/lib/pure/math.nim
index 1c47258bc..15324f882 100644
--- a/lib/pure/math.nim
+++ b/lib/pure/math.nim
@@ -60,6 +60,10 @@ import std/private/since
 
 import bitops, fenv
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 when defined(c) or defined(cpp):
   proc c_isnan(x: float): bool {.importc: "isnan", header: "<math.h>".}
     # a generic like `x: SomeFloat` might work too if this is implemented via a C macro.
diff --git a/lib/pure/options.nim b/lib/pure/options.nim
index 850bfa555..562ed6361 100644
--- a/lib/pure/options.nim
+++ b/lib/pure/options.nim
@@ -71,6 +71,10 @@ supports pattern matching on `Option`s, with the `Some(<pattern>)` and
 
 import typetraits
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 when (NimMajor, NimMinor) >= (1, 1):
   type
     SomePointer = ref | ptr | pointer | proc
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index 7c0c64276..fa379a228 100644
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -35,7 +35,7 @@ import std/private/since
 import strutils, pathnorm
 
 when defined(nimPreviewSlimSystem):
-  import std/syncio
+  import std/[syncio, assertions]
 
 const weirdTarget = defined(nimscript) or defined(js)
 
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim
index 3da9737ec..dca5099a4 100644
--- a/lib/pure/osproc.nim
+++ b/lib/pure/osproc.nim
@@ -31,6 +31,10 @@ else:
 when defined(linux) and defined(useClone):
   import linux
 
+when defined(nimPreviewSlimSystem):
+  import std/[syncio, assertions]
+
+
 type
   ProcessOption* = enum ## Options that can be passed to `startProcess proc
                         ## <#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]>`_.
diff --git a/lib/pure/parsejson.nim b/lib/pure/parsejson.nim
index 196d8c360..c92eac26e 100644
--- a/lib/pure/parsejson.nim
+++ b/lib/pure/parsejson.nim
@@ -14,6 +14,9 @@
 import strutils, lexbase, streams, unicode
 import std/private/decode_helpers
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
 type
   JsonEventKind* = enum ## enumeration of all events that may occur when parsing
     jsonError,          ## an error occurred during parsing
diff --git a/lib/pure/streamwrapper.nim b/lib/pure/streamwrapper.nim
index 7a501760b..a6c1901d2 100644
--- a/lib/pure/streamwrapper.nim
+++ b/lib/pure/streamwrapper.nim
@@ -13,6 +13,10 @@
 
 import deques, streams
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 type
   PipeOutStream*[T] = ref object of T
     # When stream peek operation is called, it reads from base stream
diff --git a/lib/pure/strformat.nim b/lib/pure/strformat.nim
index 40a33951c..ce3439600 100644
--- a/lib/pure/strformat.nim
+++ b/lib/pure/strformat.nim
@@ -316,6 +316,10 @@ single letter DSLs.
 import macros, parseutils, unicode
 import strutils except format
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 proc mkDigit(v: int, typ: char): string {.inline.} =
   assert(v < 26)
   if v < 10:
diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim
index 3b90fea50..aa2886cfa 100644
--- a/lib/pure/strtabs.nim
+++ b/lib/pure/strtabs.nim
@@ -53,6 +53,10 @@ import std/private/since
 import
   hashes, strutils
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 when defined(js) or defined(nimscript) or defined(Standalone):
   {.pragma: rtlFunc.}
 else:
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim
index 5e505ec3a..bf7bd6aa8 100644
--- a/lib/pure/strutils.nim
+++ b/lib/pure/strutils.nim
@@ -82,6 +82,9 @@ include "system/inclrtl"
 import std/private/since
 from std/private/strimpl import cmpIgnoreStyleImpl, cmpIgnoreCaseImpl, startsWithImpl, endsWithImpl
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
 
 const
   Whitespace* = {' ', '\t', '\v', '\r', '\l', '\f'}
diff --git a/lib/pure/terminal.nim b/lib/pure/terminal.nim
index 5755e142a..571c9b13c 100644
--- a/lib/pure/terminal.nim
+++ b/lib/pure/terminal.nim
@@ -67,7 +67,7 @@ when defined(windows):
   import winlean
 
 when defined(nimPreviewSlimSystem):
-  import std/syncio
+  import std/[syncio, assertions]
 
 type
   PTerminal = ref object
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index 7851bf158..b70c5cedc 100644
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -201,6 +201,10 @@ import strutils, math, options
 import std/private/since
 include "system/inclrtl"
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 when defined(js):
   import jscore
 
diff --git a/lib/pure/typetraits.nim b/lib/pure/typetraits.nim
index 8dc1b8cf2..3fc1c7c5c 100644
--- a/lib/pure/typetraits.nim
+++ b/lib/pure/typetraits.nim
@@ -15,6 +15,10 @@
 import std/private/since
 export system.`$` # for backward compatibility
 
+when defined(nimPreviewSlimSystem):
+  import std/assertions
+
+
 type HoleyEnum* = (not Ordinal) and enum ## Enum with holes.
 type OrdinalEnum* = Ordinal and enum ## Enum without holes.