mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-21 16:31:39 +00:00
Remove little lies :)
This commit is contained in:
@@ -88,10 +88,11 @@ template wrapDangerous(op, modop) {.dirty.} =
|
||||
if vmopsDanger notin c.config.features and (defined(nimsuggest) or c.config.cmd == cmdCheck):
|
||||
proc `op Wrapper`(a: VmArgs) {.nimcall.} =
|
||||
discard
|
||||
modop op
|
||||
else:
|
||||
proc `op Wrapper`(a: VmArgs) {.nimcall.} =
|
||||
op(getString(a, 0), getString(a, 1))
|
||||
modop op
|
||||
modop op
|
||||
|
||||
proc getCurrentExceptionMsgWrapper(a: VmArgs) {.nimcall.} =
|
||||
setResult(a, if a.currentException.isNil: ""
|
||||
@@ -187,9 +188,9 @@ proc registerAdditionalOps*(c: PCtx) =
|
||||
registerCallback c, "stdlib.*.staticWalkDir", proc (a: VmArgs) {.nimcall.} =
|
||||
setResult(a, staticWalkDirImpl(getString(a, 0), getBool(a, 1)))
|
||||
when defined(nimHasInvariant):
|
||||
registerCallback c, "stdlib.compilesettings.querySetting", proc (a: VmArgs) {.nimcall.} =
|
||||
registerCallback c, "stdlib.compilesettings.querySetting", proc (a: VmArgs) =
|
||||
setResult(a, querySettingImpl(c.config, getInt(a, 0)))
|
||||
registerCallback c, "stdlib.compilesettings.querySettingSeq", proc (a: VmArgs) {.nimcall.} =
|
||||
registerCallback c, "stdlib.compilesettings.querySettingSeq", proc (a: VmArgs) =
|
||||
setResult(a, querySettingSeqImpl(c.config, getInt(a, 0)))
|
||||
|
||||
if defined(nimsuggest) or c.config.cmd == cmdCheck:
|
||||
@@ -201,14 +202,14 @@ proc registerAdditionalOps*(c: PCtx) =
|
||||
registerCallback c, "stdlib.os.getCurrentCompilerExe", proc (a: VmArgs) {.nimcall.} =
|
||||
setResult(a, getAppFilename())
|
||||
|
||||
registerCallback c, "stdlib.macros.symBodyHash", proc (a: VmArgs) {.nimcall.} =
|
||||
registerCallback c, "stdlib.macros.symBodyHash", proc (a: VmArgs) =
|
||||
let n = getNode(a, 0)
|
||||
if n.kind != nkSym:
|
||||
stackTrace(c, PStackFrame(prc: c.prc.sym, comesFrom: 0, next: nil), c.exceptionInstr,
|
||||
"symBodyHash() requires a symbol. '" & $n & "' is of kind '" & $n.kind & "'", n.info)
|
||||
setResult(a, $symBodyDigest(c.graph, n.sym))
|
||||
|
||||
registerCallback c, "stdlib.macros.isExported", proc(a: VmArgs) {.nimcall.} =
|
||||
registerCallback c, "stdlib.macros.isExported", proc(a: VmArgs) =
|
||||
let n = getNode(a, 0)
|
||||
if n.kind != nkSym:
|
||||
stackTrace(c, PStackFrame(prc: c.prc.sym, comesFrom: 0, next: nil), c.exceptionInstr,
|
||||
|
||||
Reference in New Issue
Block a user