add getCurrentCompilerExe to vmops (eg allows to get nim compiler at CT); add tests for vmops (#9925)

This commit is contained in:
Timothee Cour 2018-12-18 00:07:12 -08:00 • committed by Andreas Rumpf
commit c4e3c4ca2d
6 changed files with 65 additions and 2 deletions

View file

@ -13,7 +13,7 @@ from math import sqrt, ln, log10, log2, exp, round, arccos, arcsin,
arctan, arctan2, cos, cosh, hypot, sinh, sin, tan, tanh, pow, trunc,
floor, ceil, `mod`
from os import getEnv, existsEnv, dirExists, fileExists, putEnv, walkDir
from os import getEnv, existsEnv, dirExists, fileExists, putEnv, walkDir, getAppFilename
template mathop(op) {.dirty.} =
registerCallback(c, "stdlib.math." & astToStr(op), `op Wrapper`)
@ -120,3 +120,6 @@ proc registerAdditionalOps*(c: PCtx) =
setResult(a, staticWalkDirImpl(getString(a, 0), getBool(a, 1)))
systemop gorgeEx
macrosop getProjectPath
registerCallback c, "stdlib.os.getCurrentCompilerExe", proc (a: VmArgs) {.nimcall.} =
setResult(a, getAppFilename())