summary refs log tree commit diff stats
path: root/tests/exception/texceptionbreak.nim
blob: 00dd8ed9fcd325fb5198b43c5aac07cfb401ab8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { col
discard """
  file: "tnestedbreak.nim"
  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:
    break

echo "3"

# Fourth Variety
block:
  try:
    raise newException(OSError, "Problem")
  except OSError:
    break

echo "4"
an>== ':' else: # windows, dos DirSep == '\\' "\n" == CR + LF FirstNLchar == CR DriveSeparator == ':' PathSep == ';' UpLetters == {'A'..'Z', '\xC0'..'\xDE'} DownLetters == {'a'..'z', '\xDF'..'\xFF'} Numbers == {'0'..'9'} Letters == UpLetters + DownLetters type TCharSet* = set[Char] PCharSet* = ref TCharSet # implementation