Remove little lies :)
This commit is contained in:
parent
2a8d010742
commit
26a867c83c
1 changed files with 6 additions and 5 deletions
|
|
@ -88,10 +88,11 @@ template wrapDangerous(op, modop) {.dirty.} =
|
||||||
if vmopsDanger notin c.config.features and (defined(nimsuggest) or c.config.cmd == cmdCheck):
|
if vmopsDanger notin c.config.features and (defined(nimsuggest) or c.config.cmd == cmdCheck):
|
||||||
proc `op Wrapper`(a: VmArgs) {.nimcall.} =
|
proc `op Wrapper`(a: VmArgs) {.nimcall.} =
|
||||||
discard
|
discard
|
||||||
|
modop op
|
||||||
else:
|
else:
|
||||||
proc `op Wrapper`(a: VmArgs) {.nimcall.} =
|
proc `op Wrapper`(a: VmArgs) {.nimcall.} =
|
||||||
op(getString(a, 0), getString(a, 1))
|
op(getString(a, 0), getString(a, 1))
|
||||||
modop op
|
modop op
|
||||||
|
|
||||||
proc getCurrentExceptionMsgWrapper(a: VmArgs) {.nimcall.} =
|
proc getCurrentExceptionMsgWrapper(a: VmArgs) {.nimcall.} =
|
||||||
setResult(a, if a.currentException.isNil: ""
|
setResult(a, if a.currentException.isNil: ""
|
||||||
|
|
@ -187,9 +188,9 @@ proc registerAdditionalOps*(c: PCtx) =
|
||||||
registerCallback c, "stdlib.*.staticWalkDir", proc (a: VmArgs) {.nimcall.} =
|
registerCallback c, "stdlib.*.staticWalkDir", proc (a: VmArgs) {.nimcall.} =
|
||||||
setResult(a, staticWalkDirImpl(getString(a, 0), getBool(a, 1)))
|
setResult(a, staticWalkDirImpl(getString(a, 0), getBool(a, 1)))
|
||||||
when defined(nimHasInvariant):
|
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)))
|
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)))
|
setResult(a, querySettingSeqImpl(c.config, getInt(a, 0)))
|
||||||
|
|
||||||
if defined(nimsuggest) or c.config.cmd == cmdCheck:
|
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.} =
|
registerCallback c, "stdlib.os.getCurrentCompilerExe", proc (a: VmArgs) {.nimcall.} =
|
||||||
setResult(a, getAppFilename())
|
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)
|
let n = getNode(a, 0)
|
||||||
if n.kind != nkSym:
|
if n.kind != nkSym:
|
||||||
stackTrace(c, PStackFrame(prc: c.prc.sym, comesFrom: 0, next: nil), c.exceptionInstr,
|
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)
|
"symBodyHash() requires a symbol. '" & $n & "' is of kind '" & $n.kind & "'", n.info)
|
||||||
setResult(a, $symBodyDigest(c.graph, n.sym))
|
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)
|
let n = getNode(a, 0)
|
||||||
if n.kind != nkSym:
|
if n.kind != nkSym:
|
||||||
stackTrace(c, PStackFrame(prc: c.prc.sym, comesFrom: 0, next: nil), c.exceptionInstr,
|
stackTrace(c, PStackFrame(prc: c.prc.sym, comesFrom: 0, next: nil), c.exceptionInstr,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue