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