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

move dollars out of system #20185

Closed
wants to merge 7 commits into from
Closed
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
4 changes: 2 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
- `addr` is now available for all addressable locations,
`unsafeAddr` is now deprecated and an alias for `addr`.

- `io` and `assertions` are about to move out of the `system` module.
You may instead import `std/syncio` and `std/assertions`.
- `io`, `assertions` and `dollars` are about to move out of the `system` module.
You may instead import `std/syncio`, `std/assertions` and `std/dollars`.
The `-d:nimPreviewSlimSystem` option makes these imports required.

- The `gc:v2` option is removed.
Expand Down
2 changes: 1 addition & 1 deletion compiler/ast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import
from strutils import toLowerAscii

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

export int128

Expand Down
2 changes: 1 addition & 1 deletion compiler/astalgo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import
msgs

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

when not defined(nimHasCursor):
{.pragma: cursor.}
Expand Down
2 changes: 1 addition & 1 deletion compiler/btrees.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## Nim compiler's needs.

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

const
M = 512 # max children per B-tree node = M-1
Expand Down
2 changes: 1 addition & 1 deletion compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import
injectdestructors, astmsgs, modulepaths

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

when not defined(leanCompiler):
import spawn, semparallel
Expand Down
2 changes: 1 addition & 1 deletion compiler/closureiters.nim
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ import
tables, options

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

type
Ctx = object
Expand Down
2 changes: 1 addition & 1 deletion compiler/commands.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import
from ast import setUseIc, eqTypeFlags, tfGcSafe, tfNoSideEffect

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

# but some have deps to imported modules. Yay.
bootSwitch(usedTinyC, hasTinyCBackend, "-d:tinyc")
Expand Down
3 changes: 3 additions & 0 deletions compiler/condsyms.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import
from options import Feature
from lineinfos import hintMin, hintMax, warnMin, warnMax

when defined(nimPreviewSlimSystem):
import std/dollars

proc defineSymbol*(symbols: StringTableRef; symbol: string, value: string = "true") =
symbols[symbol] = value

Expand Down
2 changes: 1 addition & 1 deletion compiler/depends.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import std/[os, strutils, parseutils]
import std/private/globs

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]


type
Expand Down
2 changes: 1 addition & 1 deletion compiler/dfa.nim
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import ast, intsets, lineinfos, renderer
import std/private/asciitables

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

type
InstrKind* = enum
Expand Down
2 changes: 1 addition & 1 deletion compiler/docgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ from std/private/globs import nativeToUnixPath
from nodejs import findNodeJs

when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]
import std/[assertions, syncio, dollars]


const
Expand Down
3 changes: 3 additions & 0 deletions compiler/evalffi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import ast, types, options, tables, dynlib, msgs, lineinfos
from os import getAppFilename
import pkg/libffi

when defined(nimPreviewSlimSystem):
import std/dollars

when defined(windows):
const libcDll = "msvcrt.dll"
elif defined(linux):
Expand Down
3 changes: 3 additions & 0 deletions compiler/evaltempl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import
strutils, options, ast, astalgo, msgs, renderer, lineinfos, idents

when defined(nimPreviewSlimSystem):
import std/dollars

type
TemplCtx = object
owner, genSymOwner: PSym
Expand Down
2 changes: 1 addition & 1 deletion compiler/extccomp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ropes, platform, condsyms, options, msgs, lineinfos, pathutils, modulepat
import std/[os, strutils, osproc, sha1, streams, sequtils, times, strtabs, json, jsonutils, sugar, parseutils]

when defined(nimPreviewSlimSystem):
import std/syncio
import std/[syncio, dollars]

type
TInfoCCProp* = enum # properties of the C compiler:
Expand Down
2 changes: 1 addition & 1 deletion compiler/ic/bitabs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import hashes, rodfiles

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

type
LitId* = distinct uint32
Expand Down
2 changes: 1 addition & 1 deletion compiler/ic/ic.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import ".." / [ast, idents, lineinfos, msgs, ropes, options,
from os import removeFile, isAbsolute

when defined(nimPreviewSlimSystem):
import std/[syncio, assertions]
import std/[syncio, assertions, dollars]

type
PackedConfig* = object
Expand Down
2 changes: 1 addition & 1 deletion compiler/ic/integrity.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import sets

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

import ".." / [ast, modulegraphs]
import packed_ast, bitabs, ic
Expand Down
2 changes: 1 addition & 1 deletion compiler/idents.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import
hashes, wordrecg

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

type
PIdent* = ref TIdent
Expand Down
2 changes: 1 addition & 1 deletion compiler/importer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import
from strutils import `%`

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

proc readExceptSet*(c: PContext, n: PNode): IntSet =
assert n.kind in {nkImportExceptStmt, nkExportExceptStmt}
Expand Down
2 changes: 1 addition & 1 deletion compiler/injectdestructors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import
varpartitions

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

from trees import exprStructuralEquivalent, getRoot

Expand Down
2 changes: 1 addition & 1 deletion compiler/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import
import json, sets, math, tables, intsets, strutils

when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]
import std/[assertions, syncio, dollars]


type
Expand Down
2 changes: 1 addition & 1 deletion compiler/lambdalifting.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import
transf, liftdestructors, typeallowed

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

discard """
The basic approach is that captured vars need to be put on the heap and
Expand Down
2 changes: 1 addition & 1 deletion compiler/lexer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import
wordrecg, lineinfos, pathutils, parseutils

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

const
MaxLineLength* = 80 # lines longer than this lead to a warning
Expand Down
3 changes: 3 additions & 0 deletions compiler/linter.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import std/strutils
from std/sugar import dup

when defined(nimPreviewSlimSystem):
import std/dollars

import options, ast, msgs, idents, lineinfos, wordrecg, astmsgs, semdata, packages
export packages

Expand Down
2 changes: 1 addition & 1 deletion compiler/lookups.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import std/[algorithm, strutils]

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

import
intsets, ast, astalgo, idents, semdata, types, msgs, options,
Expand Down
2 changes: 1 addition & 1 deletion compiler/lowerings.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ast, astalgo, types, idents, magicsys, msgs, options, modulegraphs,
lineinfos

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

proc newDeref*(n: PNode): PNode {.inline.} =
result = newNodeIT(nkHiddenDeref, n.info, n.typ[0])
Expand Down
3 changes: 3 additions & 0 deletions compiler/magicsys.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import
ast, astalgo, msgs, platform, idents,
modulegraphs, lineinfos

when defined(nimPreviewSlimSystem):
import std/dollars

export createMagic

proc nilOrSysInt*(g: ModuleGraph): PType = g.sysTypes[tyInt]
Expand Down
2 changes: 1 addition & 1 deletion compiler/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import


when defined(nimPreviewSlimSystem):
import std/[syncio, assertions]
import std/[syncio, assertions, dollars]

import ic / [cbackend, integrity, navigator]
from ic / ic import rodViewer
Expand Down
2 changes: 1 addition & 1 deletion compiler/modulegraphs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ast, astalgo, options, lineinfos,idents, btrees, ropes, msgs, pathutils,
import ic / [packed_ast, ic]

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

type
SigHash* = distinct MD5Digest
Expand Down
3 changes: 3 additions & 0 deletions compiler/modulepaths.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import ast, renderer, strutils, msgs, options, idents, os, lineinfos,
pathutils

when defined(nimPreviewSlimSystem):
import std/dollars

proc getModuleName*(conf: ConfigRef; n: PNode): string =
# This returns a short relative module name without the nim extension
# e.g. like "system", "importer" or "somepath/module"
Expand Down
2 changes: 1 addition & 1 deletion compiler/msgs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import
options, ropes, lineinfos, pathutils, strutils2

when defined(nimPreviewSlimSystem):
import std/[syncio, assertions]
import std/[syncio, assertions, dollars]


type InstantiationInfo* = typeof(instantiationInfo())
Expand Down
2 changes: 1 addition & 1 deletion compiler/ndi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import ast, msgs, ropes, options, pathutils

when defined(nimPreviewSlimSystem):
import std/[syncio, assertions]
import std/[syncio, assertions, dollars]

type
NdiFile* = object
Expand Down
2 changes: 1 addition & 1 deletion compiler/nilcheck.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ast, renderer, intsets, tables, msgs, options, lineinfos, strformat, iden
import sequtils, strutils, sets

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

# IMPORTANT: notes not up to date, i'll update this comment again
#
Expand Down
2 changes: 1 addition & 1 deletion compiler/nim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import std/[os, strutils, parseopt]

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

when defined(windows) and not defined(nimKochBootstrap):
# remove workaround pending bootstrap >= 1.5.1
Expand Down
2 changes: 1 addition & 1 deletion compiler/nimblecmd.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import parseutils, strutils, os, options, msgs, sequtils, lineinfos, pathutils,
std/sha1, tables

when defined(nimPreviewSlimSystem):
import std/[syncio, assertions]
import std/[syncio, assertions, dollars]

proc addPath*(conf: ConfigRef; path: AbsoluteDir, info: TLineInfo) =
if not conf.searchPaths.contains(path):
Expand Down
2 changes: 1 addition & 1 deletion compiler/nimpaths.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Unstable API
import os, strutils

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]


const
Expand Down
4 changes: 4 additions & 0 deletions compiler/nodejs.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import os

when defined(nimPreviewSlimSystem):
import std/dollars


proc findNodeJs*(): string {.inline.} =
## Find NodeJS executable and return it as a string.
result = findExe("nodejs")
Expand Down
3 changes: 3 additions & 0 deletions compiler/parampatterns.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import strutils, ast, types, msgs, idents, renderer, wordrecg, trees,
options

when defined(nimPreviewSlimSystem):
import std/dollars

# we precompile the pattern here for efficiency into some internal
# stack based VM :-) Why? Because it's fun; I did no benchmarks to see if that
# actually improves performance.
Expand Down
2 changes: 1 addition & 1 deletion compiler/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ when defined(nimpretty):
import layouter

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

type
Parser* = object # A Parser object represents a file that
Expand Down
3 changes: 3 additions & 0 deletions compiler/passaux.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import

from modulegraphs import ModuleGraph, PPassContext

when defined(nimPreviewSlimSystem):
import std/dollars

type
VerboseRef = ref object of PPassContext
config: ConfigRef
Expand Down
2 changes: 1 addition & 1 deletion compiler/pragmas.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import
types, lookups, lineinfos, pathutils, linter

when defined(nimPreviewSlimSystem):
import std/assertions
import std/[assertions, dollars]

from ic / ic import addCompilerProc

Expand Down
2 changes: 1 addition & 1 deletion compiler/renderer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import
lexer, options, idents, strutils, ast, msgs, lineinfos

when defined(nimPreviewSlimSystem):
import std/[syncio, assertions]
import std/[syncio, assertions, dollars]

type
TRenderFlag* = enum
Expand Down
2 changes: 1 addition & 1 deletion compiler/ropes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import
from pathutils import AbsoluteFile

when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]
import std/[assertions, syncio, dollars]


type
Expand Down
Loading