* kochdocs.nim: code cleanup

* fixes #10420
This commit is contained in:
Andreas Rumpf 2019-01-11 15:55:16 +01:00 • committed by GitHub
commit d1b7aa28e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View file

@ -63,8 +63,10 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string;
os.removeFile getString(a, 0) os.removeFile getString(a, 0)
cbos createDir: cbos createDir:
os.createDir getString(a, 0) os.createDir getString(a, 0)
cbos getOsError:
setResult(a, errorMsg) result.registerCallback "stdlib.system.getOsError",
proc (a: VmArgs) = setResult(a, errorMsg)
cbos setCurrentDir: cbos setCurrentDir:
os.setCurrentDir getString(a, 0) os.setCurrentDir getString(a, 0)
cbos getCurrentDir: cbos getCurrentDir:

View file

@ -56,12 +56,8 @@ proc nimexec*(cmd: string) =
exec findNim() & " " & cmd exec findNim() & " " & cmd
proc nimCompile*(input: string, outputDir = "bin", mode = "c", options = "") = proc nimCompile*(input: string, outputDir = "bin", mode = "c", options = "") =
# TODO: simplify pending https://github.com/nim-lang/Nim/issues/9513
var cmd = findNim() & " " & mode
let output = outputDir / input.splitFile.name.exe let output = outputDir / input.splitFile.name.exe
cmd.add " -o:" & output let cmd = findNim() & " " & mode & " -o:" & output & " " & options & " " & input
cmd.add " " & options
cmd.add " " & input
exec cmd exec cmd
const const