koch boot compiler with orc (#20467)
* koch boot compiler with orc * use orc * workaround bugs * move it * move the data
This commit is contained in:
parent
3e43ea3384
commit
ae050b05e9
5 changed files with 6 additions and 11 deletions
|
|
@ -6,7 +6,6 @@ define:booting
|
||||||
define:nimcore
|
define:nimcore
|
||||||
define:nimPreviewFloatRoundtrip
|
define:nimPreviewFloatRoundtrip
|
||||||
define:nimPreviewSlimSystem
|
define:nimPreviewSlimSystem
|
||||||
gc:refc
|
|
||||||
|
|
||||||
#import:"$projectpath/testability"
|
#import:"$projectpath/testability"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ proc semTry(c: PContext, n: PNode; flags: TExprFlags; expectedType: PType = nil)
|
||||||
|
|
||||||
if a.len == 2 and a[0].kind == nkBracket:
|
if a.len == 2 and a[0].kind == nkBracket:
|
||||||
# rewrite ``except [a, b, c]: body`` -> ```except a, b, c: body```
|
# rewrite ``except [a, b, c]: body`` -> ```except a, b, c: body```
|
||||||
a.sons[0..0] = a[0].sons
|
a.sons[0..0] = move a[0].sons
|
||||||
|
|
||||||
if a.len == 2 and a[0].isInfixAs():
|
if a.len == 2 and a[0].isInfixAs():
|
||||||
# support ``except Exception as ex: body``
|
# support ``except Exception as ex: body``
|
||||||
|
|
|
||||||
7
koch.nim
7
koch.nim
|
|
@ -537,7 +537,8 @@ proc runCI(cmd: string) =
|
||||||
# boot without -d:nimHasLibFFI to make sure this still works
|
# boot without -d:nimHasLibFFI to make sure this still works
|
||||||
# `--lib:lib` is needed for bootstrap on openbsd, for reasons described in
|
# `--lib:lib` is needed for bootstrap on openbsd, for reasons described in
|
||||||
# https://github.com/nim-lang/Nim/pull/14291 (`getAppFilename` bugsfor older nim on openbsd).
|
# https://github.com/nim-lang/Nim/pull/14291 (`getAppFilename` bugsfor older nim on openbsd).
|
||||||
kochExecFold("Boot in release mode", "boot -d:release -d:nimStrictMode --lib:lib")
|
kochExecFold("Boot in release mode", "boot -d:release --gc:refc -d:nimStrictMode --lib:lib")
|
||||||
|
kochExecFold("Boot Nim ORC", "boot -d:release --lib:lib")
|
||||||
|
|
||||||
when false: # debugging: when you need to run only 1 test in CI, use something like this:
|
when false: # debugging: when you need to run only 1 test in CI, use something like this:
|
||||||
execFold("debugging test", "nim r tests/stdlib/tosproc.nim")
|
execFold("debugging test", "nim r tests/stdlib/tosproc.nim")
|
||||||
|
|
@ -591,10 +592,6 @@ proc runCI(cmd: string) =
|
||||||
|
|
||||||
execFold("Run atlas tests", "nim c -r -d:atlasTests tools/atlas/atlas.nim clone https://github.com/disruptek/balls")
|
execFold("Run atlas tests", "nim c -r -d:atlasTests tools/atlas/atlas.nim clone https://github.com/disruptek/balls")
|
||||||
|
|
||||||
when not defined(bsd):
|
|
||||||
# the BSDs are overwhelmed already, so only run this test on the other machines:
|
|
||||||
kochExecFold("Boot Nim ORC", "boot -d:release --mm:orc --lib:lib")
|
|
||||||
|
|
||||||
proc testUnixInstall(cmdLineRest: string) =
|
proc testUnixInstall(cmdLineRest: string) =
|
||||||
csource("-d:danger" & cmdLineRest)
|
csource("-d:danger" & cmdLineRest)
|
||||||
xz(false, cmdLineRest)
|
xz(false, cmdLineRest)
|
||||||
|
|
|
||||||
|
|
@ -1211,10 +1211,10 @@ else:
|
||||||
|
|
||||||
|
|
||||||
when defined(nimSeqsV2):
|
when defined(nimSeqsV2):
|
||||||
template movingCopy(a, b) =
|
template movingCopy(a, b: typed) =
|
||||||
a = move(b)
|
a = move(b)
|
||||||
else:
|
else:
|
||||||
template movingCopy(a, b) =
|
template movingCopy(a, b: typed) =
|
||||||
shallowCopy(a, b)
|
shallowCopy(a, b)
|
||||||
|
|
||||||
proc del*[T](x: var seq[T], i: Natural) {.noSideEffect.} =
|
proc del*[T](x: var seq[T], i: Natural) {.noSideEffect.} =
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ template `[]=`*(s: string; i: int; val: char) = arrPut(s, i, val)
|
||||||
template `^^`(s, i: untyped): untyped =
|
template `^^`(s, i: untyped): untyped =
|
||||||
(when i is BackwardsIndex: s.len - int(i) else: int(i))
|
(when i is BackwardsIndex: s.len - int(i) else: int(i))
|
||||||
|
|
||||||
template spliceImpl(s, a, L, b: untyped): untyped =
|
template spliceImpl(s, a, L, b: typed): untyped =
|
||||||
# make room for additional elements or cut:
|
# make room for additional elements or cut:
|
||||||
var shift = b.len - max(0,L) # ignore negative slice size
|
var shift = b.len - max(0,L) # ignore negative slice size
|
||||||
var newLen = s.len + shift
|
var newLen = s.len + shift
|
||||||
|
|
@ -147,7 +147,6 @@ proc `[]=`*[T; U, V: Ordinal](s: var seq[T], x: HSlice[U, V], b: openArray[T]) =
|
||||||
var s = @"abcdefgh"
|
var s = @"abcdefgh"
|
||||||
s[1 .. ^2] = @"xyz"
|
s[1 .. ^2] = @"xyz"
|
||||||
assert s == @"axyzh"
|
assert s == @"axyzh"
|
||||||
|
|
||||||
let a = s ^^ x.a
|
let a = s ^^ x.a
|
||||||
let L = (s ^^ x.b) - a + 1
|
let L = (s ^^ x.b) - a + 1
|
||||||
if L == b.len:
|
if L == b.len:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue