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

bootstrap the compiler with nimPreviewSlimSystem #20176

Merged
merged 2 commits into from
Aug 9, 2022
Merged
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: 4 additions & 0 deletions compiler/depends.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import modulegraphs
import std/[os, strutils, parseutils]
import std/private/globs

when defined(nimPreviewSlimSystem):
import std/assertions


type
TGen = object of PPassContext
module: PSym
Expand Down
4 changes: 4 additions & 0 deletions compiler/docgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ from uri import encodeUrl
from std/private/globs import nativeToUnixPath
from nodejs import findNodeJs

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


const
exportSection = skField
docCmdSkip = "skip"
Expand Down
4 changes: 4 additions & 0 deletions compiler/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ import

import json, sets, math, tables, intsets, strutils

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


type
TJSGen = object of PPassContext
module: PSym
Expand Down
1 change: 1 addition & 0 deletions compiler/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ hint[XDeclaredButNotUsed]:off
define:booting
define:nimcore
define:nimPreviewFloatRoundtrip
define:nimPreviewSlimSystem

#import:"$projectpath/testability"

Expand Down
4 changes: 4 additions & 0 deletions compiler/packages.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

import "." / [options, ast, lineinfos, idents, pathutils, msgs]

when defined(nimPreviewSlimSystem):
import std/assertions


proc getPackage*(conf: ConfigRef; cache: IdentCache; fileIdx: FileIndex): PSym =
## Return a new package symbol.
##
Expand Down
4 changes: 4 additions & 0 deletions compiler/renderverbatim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import strutils

import ast, options, msgs

when defined(nimPreviewSlimSystem):
import std/assertions


const isDebug = false
when isDebug:
import renderer
Expand Down
4 changes: 4 additions & 0 deletions compiler/typesrenderer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

import renderer, strutils, ast, types

when defined(nimPreviewSlimSystem):
import std/assertions


const defaultParamSeparator* = ","

template mayNormalize(s: string): string =
Expand Down
2 changes: 1 addition & 1 deletion compiler/vmops.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ from system/formatfloat import addFloatRoundtrip, addFloatSprintf


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


# There are some useful procs in vmconv.
Expand Down
4 changes: 4 additions & 0 deletions lib/packages/docutils/dochelpers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

import rstast

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


type
LangSymbol* = object ## symbol signature in Nim
symKind*: string ## "proc", "const", "type", etc
Expand Down
4 changes: 4 additions & 0 deletions lib/packages/docutils/highlite.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ import
strutils
from algorithm import binarySearch

when defined(nimPreviewSlimSystem):
import std/assertions


type
SourceLanguage* = enum
langNone, langNim, langCpp, langCsharp, langC, langJava,
Expand Down
4 changes: 4 additions & 0 deletions lib/packages/docutils/rst.nim
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ import
std/private/miscdollars, tables, strscans
from highlite import SourceLanguage, getSourceLanguage

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


type
RstParseOption* = enum ## options for the RST parser
roSupportSmilies, ## make the RST parser support smilies like ``:)``
Expand Down
4 changes: 4 additions & 0 deletions lib/packages/docutils/rstast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

import strutils, json

when defined(nimPreviewSlimSystem):
import std/assertions


type
RstNodeKind* = enum ## the possible node kinds of an PRstNode
rnInner, # an inner node or a root
Expand Down
5 changes: 5 additions & 0 deletions lib/packages/docutils/rstgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
import strutils, os, hashes, strtabs, rstast, rst, highlite, tables, sequtils,
algorithm, parseutils, std/strbasics


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


import ../../std/private/since

const
Expand Down
3 changes: 3 additions & 0 deletions lib/pure/collections/lists.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ runnableExamples:

import std/private/since

when defined(nimPreviewSlimSystem):
import std/assertions

when not defined(nimHasCursor):
{.pragma: cursor.}

Expand Down
4 changes: 4 additions & 0 deletions lib/pure/strscans.nim
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ efficiency and perform different checks.
import macros, parseutils
import std/private/since

when defined(nimPreviewSlimSystem):
import std/assertions


proc conditionsToIfChain(n, idx, res: NimNode; start: int): NimNode =
assert n.kind == nnkStmtList
if start >= n.len: return newAssignment(res, newLit true)
Expand Down
3 changes: 3 additions & 0 deletions lib/pure/uri.nim
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ runnableExamples:
import strutils, parseutils, base64
import std/private/[since, decode_helpers]

when defined(nimPreviewSlimSystem):
import std/assertions


type
Url* = distinct string
Expand Down
4 changes: 4 additions & 0 deletions lib/pure/xmltree.nim
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ runnableExamples:
import std/private/since
import macros, strtabs, strutils

when defined(nimPreviewSlimSystem):
import std/assertions


type
XmlNode* = ref XmlNodeObj ## An XML tree consisting of XML nodes.
##
Expand Down
4 changes: 4 additions & 0 deletions lib/std/strbasics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
##
## Experimental API, subject to change.

when defined(nimPreviewSlimSystem):
import std/assertions


const whitespaces = {' ', '\t', '\v', '\r', '\l', '\f'}

proc add*(x: var string, y: openArray[char]) =
Expand Down
3 changes: 3 additions & 0 deletions lib/system/threads.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
when not declared(ThisIsSystem):
{.error: "You must not import this module explicitly".}

when defined(nimPreviewSlimSystem):
import std/assertions

const
hasAllocStack = defined(zephyr) # maybe freertos too?

Expand Down