bootstrap the compiler with nimPreviewSlimSystem (#20176)
* bootstrap the compiler with nimPreviewSlimSystem * threads
This commit is contained in:
parent
cddd4de658
commit
e8ae2dc90b
19 changed files with 68 additions and 1 deletions
|
|
@ -16,6 +16,10 @@ import modulegraphs
|
||||||
import std/[os, strutils, parseutils]
|
import std/[os, strutils, parseutils]
|
||||||
import std/private/globs
|
import std/private/globs
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TGen = object of PPassContext
|
TGen = object of PPassContext
|
||||||
module: PSym
|
module: PSym
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,10 @@ from uri import encodeUrl
|
||||||
from std/private/globs import nativeToUnixPath
|
from std/private/globs import nativeToUnixPath
|
||||||
from nodejs import findNodeJs
|
from nodejs import findNodeJs
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/[assertions, syncio]
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
exportSection = skField
|
exportSection = skField
|
||||||
docCmdSkip = "skip"
|
docCmdSkip = "skip"
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,10 @@ import
|
||||||
|
|
||||||
import json, sets, math, tables, intsets, strutils
|
import json, sets, math, tables, intsets, strutils
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/[assertions, syncio]
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TJSGen = object of PPassContext
|
TJSGen = object of PPassContext
|
||||||
module: PSym
|
module: PSym
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ hint[XDeclaredButNotUsed]:off
|
||||||
define:booting
|
define:booting
|
||||||
define:nimcore
|
define:nimcore
|
||||||
define:nimPreviewFloatRoundtrip
|
define:nimPreviewFloatRoundtrip
|
||||||
|
define:nimPreviewSlimSystem
|
||||||
|
|
||||||
#import:"$projectpath/testability"
|
#import:"$projectpath/testability"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,10 @@
|
||||||
|
|
||||||
import "." / [options, ast, lineinfos, idents, pathutils, msgs]
|
import "." / [options, ast, lineinfos, idents, pathutils, msgs]
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
proc getPackage*(conf: ConfigRef; cache: IdentCache; fileIdx: FileIndex): PSym =
|
proc getPackage*(conf: ConfigRef; cache: IdentCache; fileIdx: FileIndex): PSym =
|
||||||
## Return a new package symbol.
|
## Return a new package symbol.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@ import strutils
|
||||||
|
|
||||||
import ast, options, msgs
|
import ast, options, msgs
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
const isDebug = false
|
const isDebug = false
|
||||||
when isDebug:
|
when isDebug:
|
||||||
import renderer
|
import renderer
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@
|
||||||
|
|
||||||
import renderer, strutils, ast, types
|
import renderer, strutils, ast, types
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
const defaultParamSeparator* = ","
|
const defaultParamSeparator* = ","
|
||||||
|
|
||||||
template mayNormalize(s: string): string =
|
template mayNormalize(s: string): string =
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ from system/formatfloat import addFloatRoundtrip, addFloatSprintf
|
||||||
|
|
||||||
|
|
||||||
when defined(nimPreviewSlimSystem):
|
when defined(nimPreviewSlimSystem):
|
||||||
import std/[syncio, assertions]
|
import std/syncio
|
||||||
|
|
||||||
|
|
||||||
# There are some useful procs in vmconv.
|
# There are some useful procs in vmconv.
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@
|
||||||
|
|
||||||
import rstast
|
import rstast
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/[assertions, syncio]
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
LangSymbol* = object ## symbol signature in Nim
|
LangSymbol* = object ## symbol signature in Nim
|
||||||
symKind*: string ## "proc", "const", "type", etc
|
symKind*: string ## "proc", "const", "type", etc
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,10 @@ import
|
||||||
strutils
|
strutils
|
||||||
from algorithm import binarySearch
|
from algorithm import binarySearch
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
SourceLanguage* = enum
|
SourceLanguage* = enum
|
||||||
langNone, langNim, langCpp, langCsharp, langC, langJava,
|
langNone, langNim, langCpp, langCsharp, langC, langJava,
|
||||||
|
|
|
||||||
|
|
@ -238,6 +238,10 @@ import
|
||||||
std/private/miscdollars, tables, strscans
|
std/private/miscdollars, tables, strscans
|
||||||
from highlite import SourceLanguage, getSourceLanguage
|
from highlite import SourceLanguage, getSourceLanguage
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/[assertions, syncio]
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
RstParseOption* = enum ## options for the RST parser
|
RstParseOption* = enum ## options for the RST parser
|
||||||
roSupportSmilies, ## make the RST parser support smilies like ``:)``
|
roSupportSmilies, ## make the RST parser support smilies like ``:)``
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@
|
||||||
|
|
||||||
import strutils, json
|
import strutils, json
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
RstNodeKind* = enum ## the possible node kinds of an PRstNode
|
RstNodeKind* = enum ## the possible node kinds of an PRstNode
|
||||||
rnInner, # an inner node or a root
|
rnInner, # an inner node or a root
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,11 @@
|
||||||
import strutils, os, hashes, strtabs, rstast, rst, highlite, tables, sequtils,
|
import strutils, os, hashes, strtabs, rstast, rst, highlite, tables, sequtils,
|
||||||
algorithm, parseutils, std/strbasics
|
algorithm, parseutils, std/strbasics
|
||||||
|
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/[assertions, syncio]
|
||||||
|
|
||||||
|
|
||||||
import ../../std/private/since
|
import ../../std/private/since
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,9 @@ runnableExamples:
|
||||||
|
|
||||||
import std/private/since
|
import std/private/since
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
when not defined(nimHasCursor):
|
when not defined(nimHasCursor):
|
||||||
{.pragma: cursor.}
|
{.pragma: cursor.}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -286,6 +286,10 @@ efficiency and perform different checks.
|
||||||
import macros, parseutils
|
import macros, parseutils
|
||||||
import std/private/since
|
import std/private/since
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
proc conditionsToIfChain(n, idx, res: NimNode; start: int): NimNode =
|
proc conditionsToIfChain(n, idx, res: NimNode; start: int): NimNode =
|
||||||
assert n.kind == nnkStmtList
|
assert n.kind == nnkStmtList
|
||||||
if start >= n.len: return newAssignment(res, newLit true)
|
if start >= n.len: return newAssignment(res, newLit true)
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ runnableExamples:
|
||||||
import strutils, parseutils, base64
|
import strutils, parseutils, base64
|
||||||
import std/private/[since, decode_helpers]
|
import std/private/[since, decode_helpers]
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
Url* = distinct string
|
Url* = distinct string
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ runnableExamples:
|
||||||
import std/private/since
|
import std/private/since
|
||||||
import macros, strtabs, strutils
|
import macros, strtabs, strutils
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
XmlNode* = ref XmlNodeObj ## An XML tree consisting of XML nodes.
|
XmlNode* = ref XmlNodeObj ## An XML tree consisting of XML nodes.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@
|
||||||
##
|
##
|
||||||
## Experimental API, subject to change.
|
## Experimental API, subject to change.
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
|
|
||||||
const whitespaces = {' ', '\t', '\v', '\r', '\l', '\f'}
|
const whitespaces = {' ', '\t', '\v', '\r', '\l', '\f'}
|
||||||
|
|
||||||
proc add*(x: var string, y: openArray[char]) =
|
proc add*(x: var string, y: openArray[char]) =
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,9 @@
|
||||||
when not declared(ThisIsSystem):
|
when not declared(ThisIsSystem):
|
||||||
{.error: "You must not import this module explicitly".}
|
{.error: "You must not import this module explicitly".}
|
||||||
|
|
||||||
|
when defined(nimPreviewSlimSystem):
|
||||||
|
import std/assertions
|
||||||
|
|
||||||
const
|
const
|
||||||
hasAllocStack = defined(zephyr) # maybe freertos too?
|
hasAllocStack = defined(zephyr) # maybe freertos too?
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue