mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
31 lines
386 B
Nim
31 lines
386 B
Nim
discard """
|
|
file: "tfinally2.nim"
|
|
output: '''A
|
|
B
|
|
C
|
|
D'''
|
|
"""
|
|
# Test break in try statement:
|
|
|
|
proc main: int =
|
|
try:
|
|
block AB:
|
|
try:
|
|
try:
|
|
break AB
|
|
finally:
|
|
echo("A")
|
|
echo("skipped")
|
|
finally:
|
|
block B:
|
|
echo("B")
|
|
echo("skipped")
|
|
echo("C")
|
|
finally:
|
|
echo("D")
|
|
|
|
discard main() #OUT ABCD
|
|
|
|
|
|
|