implements experimental new config system based on NimScript
This commit is contained in:
parent
d81578cb9b
commit
69b32637b1
13 changed files with 398 additions and 69 deletions
|
|
@ -182,7 +182,10 @@ proc readAllFile(file: File): string =
|
|||
proc readAll(file: File): TaintedString =
|
||||
# Separate handling needed because we need to buffer when we
|
||||
# don't know the overall length of the File.
|
||||
let len = if file != stdin: rawFileSize(file) else: -1
|
||||
when declared(stdin):
|
||||
let len = if file != stdin: rawFileSize(file) else: -1
|
||||
else:
|
||||
let len = rawFileSize(file)
|
||||
if len > 0:
|
||||
result = readAllFile(file, len).TaintedString
|
||||
else:
|
||||
|
|
@ -216,9 +219,9 @@ proc writeLine[Ty](f: File, x: varargs[Ty, `$`]) =
|
|||
for i in items(x): write(f, i)
|
||||
write(f, "\n")
|
||||
|
||||
|
||||
proc rawEcho(x: string) {.inline, compilerproc.} = write(stdout, x)
|
||||
proc rawEchoNL() {.inline, compilerproc.} = write(stdout, "\n")
|
||||
when declared(stdout):
|
||||
proc rawEcho(x: string) {.inline, compilerproc.} = write(stdout, x)
|
||||
proc rawEchoNL() {.inline, compilerproc.} = write(stdout, "\n")
|
||||
|
||||
# interface to the C procs:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue