This commit is contained in:
Araq
2015-10-07 10:03:13 +02:00
parent dfaa63e805
commit 48036fa3d9

View File

@@ -469,10 +469,10 @@ type
fullPath: string # This is a canonical full filesystem path
projPath*: string # This is relative to the project's root
shortName*: string # short name of the module
quotedName*: Rope # cached quoted short name for codegen
quotedName*: Rope # cached quoted short name for codegen
# purposes
lines*: seq[Rope] # the source code of the module
lines*: seq[Rope] # the source code of the module
# used for better error messages and
# embedding the original source in the
# generated code
@@ -631,8 +631,11 @@ var
proc suggestWriteln*(s: string) =
if eStdOut in errorOutputs:
if isNil(writelnHook): writeLine(stdout, s)
else: writelnHook(s)
if isNil(writelnHook):
writeLine(stdout, s)
flushFile(stdout)
else:
writelnHook(s)
proc msgQuit*(x: int8) = quit x
proc msgQuit*(x: string) = quit x
@@ -726,7 +729,9 @@ var gTrackPos*: TLineInfo
proc outWriteln*(s: string) =
## Writes to stdout. Always.
if eStdOut in errorOutputs: writeLine(stdout, s)
if eStdOut in errorOutputs:
writeLine(stdout, s)
flushFile(stdout)
proc msgWriteln*(s: string) =
## Writes to stdout. If --stdout option is given, writes to stderr instead.
@@ -736,9 +741,13 @@ proc msgWriteln*(s: string) =
if not isNil(writelnHook):
writelnHook(s)
elif optStdout in gGlobalOptions:
if eStdErr in errorOutputs: writeLine(stderr, s)
if eStdErr in errorOutputs:
writeLine(stderr, s)
flushFile(stderr)
else:
if eStdOut in errorOutputs: writeLine(stdout, s)
if eStdOut in errorOutputs:
writeLine(stdout, s)
flushFile(stdout)
macro callIgnoringStyle(theProc: typed, first: typed,
args: varargs[expr]): stmt =
@@ -773,13 +782,16 @@ template styledMsgWriteln*(args: varargs[expr]) =
if not isNil(writelnHook):
callIgnoringStyle(callWritelnHook, nil, args)
elif optStdout in gGlobalOptions:
if eStdErr in errorOutputs: callIgnoringStyle(writeLine, stderr, args)
if eStdErr in errorOutputs:
callIgnoringStyle(writeLine, stderr, args)
flushFile(stderr)
else:
if eStdOut in errorOutputs:
if optUseColors in gGlobalOptions:
callStyledEcho(args)
else:
callIgnoringStyle(writeLine, stdout, args)
flushFile stdout
proc coordToStr(coord: int): string =
if coord == -1: result = "???"