Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[std/os] split and re-export #20593

Merged
merged 15 commits into from
Oct 20, 2022
9 changes: 6 additions & 3 deletions compiler/vmops.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be changed to from std/private/oscommon import dirExists, fileExists in the following PRs because of bootstrapping.


from std/times import cpuTime
from std/hashes import hash
Expand All @@ -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`)

Expand Down Expand Up @@ -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)
Expand Down
Loading