From f6a002c8a582d83e9d7b51b945d26cf428699ad9 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 20 Oct 2022 13:58:29 +0800 Subject: [std/os] split and re-export (#20593) * [std/os] split and export * move to private modules * fixes docs and tests Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com> --- compiler/vmops.nim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/vmops.nim') diff --git a/compiler/vmops.nim b/compiler/vmops.nim index 932783097..49b853790 100644 --- a/compiler/vmops.nim +++ b/compiler/vmops.nim @@ -22,8 +22,9 @@ when declared(math.signbit): # ditto from std/math as math3 import signbit + from std/envvars import getEnv, existsEnv, delEnv, putEnv, envPairs -from std/os import dirExists, fileExists, walkDir, getAppFilename +from std/os import walkDir, getAppFilename, dirExists, fileExists from std/times import cpuTime from std/hashes import hash @@ -44,6 +45,8 @@ template mathop(op) {.dirty.} = template osop(op) {.dirty.} = registerCallback(c, "stdlib.os." & astToStr(op), `op Wrapper`) +template oscommonop(op) {.dirty.} = + registerCallback(c, "stdlib.oscommon." & astToStr(op), `op Wrapper`) template envvarsop(op) {.dirty.} = registerCallback(c, "stdlib.envvars." & astToStr(op), `op Wrapper`) @@ -226,8 +229,8 @@ proc registerAdditionalOps*(c: PCtx) = wrap1s(existsEnv, envvarsop) wrap2svoid(putEnv, envvarsop) wrap1svoid(delEnv, envvarsop) - wrap1s(dirExists, osop) - wrap1s(fileExists, osop) + wrap1s(dirExists, oscommonop) + wrap1s(fileExists, oscommonop) wrapDangerous(writeFile, ioop) wrap1s(readFile, ioop) wrap2si(readLines, ioop) -- cgit 1.4.1-2-gfad0