Fixed issue 391 (nested break in except-stmts)

This commit is contained in:
Audun Wilhelmsen
2014-02-16 02:08:36 +01:00
parent f701ee086a
commit 8cccaebc2e
3 changed files with 71 additions and 9 deletions

View File

@@ -0,0 +1,45 @@
discard """
file: "tnestedbreak.nim"
output: "1\n2\n3\n4"
"""
# First variety
try:
raise newException(EOS, "Problem")
except EOS:
for y in [1, 2, 3]:
discard
try:
discard
except EOS:
discard
echo "1"
# Second Variety
try:
raise newException(EOS, "Problem")
except EOS:
for y in [1, 2, 3]:
discard
for y in [1, 2, 3]:
discard
echo "2"
# Third Variety
try:
raise newException(EOS, "Problem")
except EOS:
block:
break
echo "3"
# Fourth Variety
block:
try:
raise newException(EOS, "Problem")
except EOS:
break
echo "4"