remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 (#16918)
* nimNoArrayToCstringConversion deadcode * nimbabel deadcode * nimHasalignOf deadcode * nimvarargstyped deadcode * nimhygiene deadcode * nimNewTypedesc deadcode * nimlocks deadcode * nimHasCppDefine deadcode * nimHasRunnableExamples deadcode * nimHasNilChecks deadcode * nimSymKind deadcode * minor macros refactoring * nimVmEqIdent deadcode * nimNoNil deadcode * nimNoZeroTerminator deadcode * nimHasSymOwnerInMacro deadcode * nimVmExportFixed deadcode * nimNewRuntime deadcode * nimAshr deadcode * nimUncheckedArrayTyp deadcode * nimHasTypeof deadcode * nimErrorProcCanHaveBody deadcode * nimHasHotCodeReloading deadcode * nimHasSignatureHashInMacro deadcode * nimHasDefault deadcode * nimMacrosSizealignof deadcode
This commit is contained in:
parent
e463a67c74
commit
b9994925f5
27 changed files with 555 additions and 734 deletions
|
|
@ -13,11 +13,6 @@
|
|||
const
|
||||
growthFactor = 2
|
||||
|
||||
when not defined(nimHasDefault):
|
||||
template default[T](t: typedesc[T]): T =
|
||||
var v: T
|
||||
v
|
||||
|
||||
# hcode for real keys cannot be zero. hcode==0 signifies an empty slot. These
|
||||
# two procs retain clarity of that encoding without the space cost of an enum.
|
||||
proc isEmpty(hcode: Hash): bool {.inline.} =
|
||||
|
|
|
|||
|
|
@ -60,9 +60,6 @@ runnableExamples:
|
|||
|
||||
import std/private/since
|
||||
|
||||
when not defined(nimhygiene):
|
||||
{.pragma: dirty.}
|
||||
|
||||
when not defined(nimHasCursor):
|
||||
{.pragma: cursor.}
|
||||
|
||||
|
|
|
|||
|
|
@ -84,10 +84,6 @@ import std/private/since
|
|||
|
||||
import macros
|
||||
|
||||
when not defined(nimhygiene):
|
||||
{.pragma: dirty.}
|
||||
|
||||
|
||||
macro evalOnceAs(expAlias, exp: untyped,
|
||||
letAssigneable: static[bool]): untyped =
|
||||
## Injects `expAlias` in caller scope, to avoid bugs involving multiple
|
||||
|
|
@ -956,16 +952,10 @@ template mapIt*(s: typed, op: untyped): untyped =
|
|||
strings = nums.mapIt($(4 * it))
|
||||
assert strings == @["4", "8", "12", "16"]
|
||||
|
||||
when defined(nimHasTypeof):
|
||||
type OutType = typeof((
|
||||
block:
|
||||
var it{.inject.}: typeof(items(s), typeOfIter);
|
||||
op), typeOfProc)
|
||||
else:
|
||||
type OutType = typeof((
|
||||
block:
|
||||
var it{.inject.}: typeof(items(s));
|
||||
op))
|
||||
type OutType = typeof((
|
||||
block:
|
||||
var it{.inject.}: typeof(items(s), typeOfIter);
|
||||
op), typeOfProc)
|
||||
when OutType is not (proc):
|
||||
# Here, we avoid to create closures in loops.
|
||||
# This avoids https://github.com/nim-lang/Nim/issues/12625
|
||||
|
|
@ -996,11 +986,7 @@ template mapIt*(s: typed, op: untyped): untyped =
|
|||
# With this fallback, above code can be simplified to:
|
||||
# [1, 2].mapIt((x: int) => it + x)
|
||||
# In this case, `mapIt` is just syntax sugar for `map`.
|
||||
|
||||
when defined(nimHasTypeof):
|
||||
type InType = typeof(items(s), typeOfIter)
|
||||
else:
|
||||
type InType = typeof(items(s))
|
||||
type InType = typeof(items(s), typeOfIter)
|
||||
# Use a help proc `f` to create closures for each element in `s`
|
||||
let f = proc (x: InType): OutType =
|
||||
let it {.inject.} = x
|
||||
|
|
|
|||
|
|
@ -51,9 +51,6 @@ import
|
|||
hashes, math
|
||||
|
||||
{.pragma: myShallow.}
|
||||
when not defined(nimhygiene):
|
||||
{.pragma: dirty.}
|
||||
|
||||
# For "integer-like A" that are too big for intsets/bit-vectors to be practical,
|
||||
# it would be best to shrink hcode to the same size as the integer. Larger
|
||||
# codes should never be needed, and this can pack more entries per cache-line.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue