change system.nim to adhere to the style guide

This commit is contained in:
Araq
2018-10-30 15:01:57 +01:00
parent 05964b95e4
commit 5c25b93898

View File

@@ -60,7 +60,7 @@ var
# list of exception handlers
# a global variable for the root of all try blocks
currException {.threadvar.}: ref Exception
raise_counter {.threadvar.}: uint
raiseCounter {.threadvar.}: uint
gcFramePtr {.threadvar.}: GcFrame
@@ -122,12 +122,12 @@ proc popCurrentException {.compilerRtl, inl.} =
proc popCurrentExceptionEx(id: uint) {.compilerRtl.} =
# in cpp backend exceptions can pop-up in the different order they were raised, example #5628
if currException.raise_id == id:
if currException.raiseId == id:
currException = currException.up
else:
var cur = currException.up
var prev = currException
while cur != nil and cur.raise_id != id:
while cur != nil and cur.raiseId != id:
prev = cur
cur = cur.up
if cur == nil:
@@ -345,10 +345,10 @@ proc raiseExceptionAux(e: ref Exception) =
quitOrDebug()
else:
pushCurrentException(e)
raise_counter.inc
if raise_counter == 0:
raise_counter.inc # skip zero at overflow
e.raise_id = raise_counter
raiseCounter.inc
if raiseCounter == 0:
raiseCounter.inc # skip zero at overflow
e.raiseId = raiseCounter
{.emit: "`e`->raise();".}
else:
if excHandler != nil:
@@ -382,7 +382,7 @@ proc raiseExceptionAux(e: ref Exception) =
var buf: array[0..2000, char]
var L = 0
if e.trace.len != 0:
add(buf, $e.trace) # gc allocation
add(buf, $e.trace) # gc allocation
add(buf, "Error: unhandled exception: ")
add(buf, e.msg)
add(buf, " [")