mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
* unnamed break in the block now gives an error * bootstrap * fixes * more fixes * break with label * label again * one moee * Delete test5.txt * it now gives a UnnamedBreak warning * change the URL of bump back to the original one
45 lines
613 B
Nim
45 lines
613 B
Nim
discard """
|
|
output: "1\n2\n3\n4"
|
|
"""
|
|
|
|
# First variety
|
|
try:
|
|
raise newException(OSError, "Problem")
|
|
except OSError:
|
|
for y in [1, 2, 3]:
|
|
discard
|
|
try:
|
|
discard
|
|
except OSError:
|
|
discard
|
|
echo "1"
|
|
|
|
# Second Variety
|
|
try:
|
|
raise newException(OSError, "Problem")
|
|
except OSError:
|
|
for y in [1, 2, 3]:
|
|
discard
|
|
for y in [1, 2, 3]:
|
|
discard
|
|
|
|
echo "2"
|
|
|
|
# Third Variety
|
|
try:
|
|
raise newException(OSError, "Problem")
|
|
except OSError:
|
|
block label:
|
|
break label
|
|
|
|
echo "3"
|
|
|
|
# Fourth Variety
|
|
block label:
|
|
try:
|
|
raise newException(OSError, "Problem")
|
|
except OSError:
|
|
break label
|
|
|
|
echo "4"
|