summary refs log tree commit diff stats
path: root/compiler/vmops.nim
diff options
context:
space:
mode:
authordata-man <datamanrb@gmail.com>2018-05-19 16:19:29 +0300
committerdata-man <datamanrb@gmail.com>2018-05-19 16:19:29 +0300
commit2a9843c68fc60be6bcb41771dce88df004868e42 (patch)
treeaf0396a389f0d35b9239827a7915139e72e6ad9b /compiler/vmops.nim
parent606d8b2f6d0ed4c26d44d2b07b8fef39cabc0b3c (diff)
parent04ddd069a1b3315dc0e323d98fefd621d1430a4d (diff)
downloadNim-2a9843c68fc60be6bcb41771dce88df004868e42.tar.gz
Merge branch 'devel' of https://github.com/nim-lang/Nim into fix_2753
Diffstat (limited to 'compiler/vmops.nim')
-rw-r--r--compiler/vmops.nim16
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/vmops.nim b/compiler/vmops.nim
index 7f8bf06c1..617295b0d 100644
--- a/compiler/vmops.nim
+++ b/compiler/vmops.nim
@@ -15,8 +15,6 @@ from math import sqrt, ln, log10, log2, exp, round, arccos, arcsin,
 
 from os import getEnv, existsEnv, dirExists, fileExists, putEnv, walkDir
 
-from options import gProjectPath
-
 template mathop(op) {.dirty.} =
   registerCallback(c, "stdlib.math." & astToStr(op), `op Wrapper`)
 
@@ -77,15 +75,15 @@ proc staticWalkDirImpl(path: string, relative: bool): PNode =
     result.add newTree(nkTupleConstr, newIntNode(nkIntLit, k.ord),
                               newStrNode(nkStrLit, f))
 
-proc gorgeExWrapper(a: VmArgs) {.nimcall.} =
-  let (s, e) = opGorge(getString(a, 0), getString(a, 1), getString(a, 2),
-                       a.currentLineInfo)
-  setResult a, newTree(nkTupleConstr, newStrNode(nkStrLit, s), newIntNode(nkIntLit, e))
+proc registerAdditionalOps*(c: PCtx) =
+  proc gorgeExWrapper(a: VmArgs) =
+    let (s, e) = opGorge(getString(a, 0), getString(a, 1), getString(a, 2),
+                         a.currentLineInfo, c.config)
+    setResult a, newTree(nkTupleConstr, newStrNode(nkStrLit, s), newIntNode(nkIntLit, e))
 
-proc getProjectPathWrapper(a: VmArgs) {.nimcall.} =
-  setResult a, gProjectPath
+  proc getProjectPathWrapper(a: VmArgs) =
+    setResult a, c.config.projectPath
 
-proc registerAdditionalOps*(c: PCtx) =
   wrap1f_math(sqrt)
   wrap1f_math(ln)
   wrap1f_math(log10)