fixes for exception handling; added system.compileOption

This commit is contained in:
Araq 2010-09-13 00:52:44 +02:00
commit 866572e2e4
18 changed files with 329 additions and 165 deletions

View file

@ -0,0 +1,21 @@
type
ESomething = object of E_Base
ESomeOtherErr = object of E_Base
proc genErrors(s: string) =
if s == "error!":
raise newException(ESomething, "Test")
else:
raise newException(EsomeotherErr, "bla")
try:
for i in 0..3:
try:
genErrors("error!")
except ESomething:
echo("Error happened")
echo "came here"
raise newException(EsomeotherErr, "bla")
finally:
echo "caught"

5
tests/accept/run/toverflw2.nim Executable file
View file

@ -0,0 +1,5 @@
var a : int32 = 2147483647
var b : int32 = 2147483647
var c = a + b