diff options
author | Araq <rumpf_a@web.de> | 2011-02-13 03:39:11 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-02-13 03:39:11 +0100 |
commit | 627e192f64fbfadb6db48ae31cf518973d380928 (patch) | |
tree | bf4bfe805660ffe234159d52927ba68e96e49e84 /lib | |
parent | 5b28d08203ba36e84c8e381761db182c0393d07f (diff) | |
download | Nim-627e192f64fbfadb6db48ae31cf518973d380928.tar.gz |
basic continue after error works; interactive mode more useful
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/system.nim | 15 | ||||
-rwxr-xr-x | lib/system/mmdisp.nim | 4 |
2 files changed, 9 insertions, 10 deletions
diff --git a/lib/system.nim b/lib/system.nim index 7822e6cad..cf92594d9 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -747,7 +747,7 @@ proc compileOption*(option, arg: string): bool {. include "system/inclrtl" -when not defined(ecmascript): +when not defined(ecmascript) and not defined(nimrodVm): include "system/cgprocs" proc add *[T](x: var seq[T], y: T) {.magic: "AppendSeqElem", noSideEffect.} @@ -1334,10 +1334,6 @@ proc quit*(errorcode: int = QuitSuccess) {. ## It does *not* call the garbage collector to free all the memory, ## unless a quit procedure calls ``GC_collect``. -when not defined(EcmaScript) and not defined(NimrodVM): - proc quit*(errormsg: string) {.noReturn.} - ## a shorthand for ``echo(errormsg); quit(quitFailure)``. - when not defined(EcmaScript) and not defined(NimrodVM): proc atomicInc*(memLoc: var int, x: int): int {.inline.} @@ -1558,10 +1554,6 @@ when not defined(EcmaScript) and not defined(NimrodVM): ## returns the OS file handle of the file ``f``. This is only useful for ## platform specific programming. - proc quit(errormsg: string) = - echo(errormsg) - quit(quitFailure) - proc cstringArrayToSeq*(a: cstringArray, len: int): seq[string] = ## converts a ``cstringArray`` to a ``seq[string]``. `a` is supposed to be ## of length ``len``. @@ -1669,5 +1661,10 @@ elif defined(ecmaScript) or defined(NimrodVM): if x < y: return -1 return 1 +proc quit*(errormsg: string) {.noReturn.} = + ## a shorthand for ``echo(errormsg); quit(quitFailure)``. + echo(errormsg) + quit(quitFailure) + {.pop.} # checks {.pop.} # hints diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim index a85d69b0d..de604869b 100755 --- a/lib/system/mmdisp.nim +++ b/lib/system/mmdisp.nim @@ -56,7 +56,9 @@ var gOutOfMem: ref EOutOfMemory proc raiseOutOfMem() {.noreturn.} = - if gOutOfMem == nil: quit("out of memory; cannot even throw an exception") + if gOutOfMem == nil: + echo("out of memory; cannot even throw an exception") + quit(1) gOutOfMem.msg = "out of memory" raise gOutOfMem |