mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
nimvm is magic
This commit is contained in:
@@ -605,7 +605,8 @@ type
|
||||
mNBindSym, mLocals, mNCallSite,
|
||||
mEqIdent, mEqNimrodNode, mSameNodeType, mGetImpl,
|
||||
mNHint, mNWarning, mNError,
|
||||
mInstantiationInfo, mGetTypeInfo, mNGenSym
|
||||
mInstantiationInfo, mGetTypeInfo, mNGenSym,
|
||||
mNimvm
|
||||
|
||||
# things that we can evaluate safely at compile time, even if not asked for it:
|
||||
const
|
||||
|
||||
@@ -640,6 +640,8 @@ proc getConstExpr(m: PSym, n: PNode): PNode =
|
||||
of mNaN: result = newFloatNodeT(NaN, n)
|
||||
of mInf: result = newFloatNodeT(Inf, n)
|
||||
of mNegInf: result = newFloatNodeT(NegInf, n)
|
||||
of mNimvm:
|
||||
localError(n.info, "illegal context for 'nimvm' magic")
|
||||
else:
|
||||
if sfFakeConst notin s.flags: result = copyTree(s.ast)
|
||||
of {skProc, skMethod}:
|
||||
|
||||
@@ -1173,6 +1173,10 @@ const
|
||||
## "i386", "alpha", "powerpc", "powerpc64", "powerpc64el", "sparc",
|
||||
## "amd64", "mips", "mipsel", "arm", "arm64".
|
||||
|
||||
nimvm* {.magic: "Nimvm".}: bool = false
|
||||
## may be used only in "when" expression.
|
||||
## It is true in Nim VM context and false otherwise
|
||||
|
||||
seqShallowFlag = low(int)
|
||||
|
||||
proc compileOption*(option: string): bool {.
|
||||
|
||||
Reference in New Issue
Block a user