concept example from the manual now works again
This commit is contained in:
parent
f6ff01572e
commit
3bcafb1c3a
5 changed files with 18 additions and 32 deletions
|
|
@ -587,22 +587,15 @@ proc unknownLineInfo*(): TLineInfo =
|
|||
var
|
||||
msgContext: seq[TLineInfo] = @[]
|
||||
lastError = unknownLineInfo()
|
||||
bufferedMsgs*: seq[string]
|
||||
|
||||
errorOutputs* = {eStdOut, eStdErr}
|
||||
writelnHook*: proc (output: string) {.closure.}
|
||||
|
||||
proc clearBufferedMsgs* =
|
||||
bufferedMsgs = nil
|
||||
|
||||
proc suggestWriteln*(s: string) =
|
||||
if eStdOut in errorOutputs:
|
||||
if isNil(writelnHook): writeln(stdout, s)
|
||||
else: writelnHook(s)
|
||||
|
||||
if eInMemory in errorOutputs:
|
||||
bufferedMsgs.safeAdd(s)
|
||||
|
||||
proc msgQuit*(x: int8) = quit x
|
||||
proc msgQuit*(x: string) = quit x
|
||||
|
||||
|
|
@ -705,8 +698,6 @@ proc msgWriteln*(s: string) =
|
|||
else:
|
||||
if eStdOut in errorOutputs: writeln(stdout, s)
|
||||
|
||||
if eInMemory in errorOutputs: bufferedMsgs.safeAdd(s)
|
||||
|
||||
proc coordToStr(coord: int): string =
|
||||
if coord == -1: result = "???"
|
||||
else: result = $coord
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue