summary refs log tree commit diff stats
path: root/tests/macros/tmacros1.nim
Commit message (Expand)AuthorAgeFilesLines
* fix for passing tuples as static params to macros (#11423); fixes #10751 [bug...Arne Döring2019-06-071-0/+12
* fix for return in macro (#9666); fixes #5874Arne Döring2019-05-201-1/+23
* make tests green againAndreas Rumpf2018-06-111-3/+3
* Remove expr/stmt (#5857)Arne Döring2017-07-251-3/+1
* Rename PNimrodNode to NimNodedef2015-03-171-2/+2
* better testerAraq2014-01-171-0/+31
e previous revision' href='/ahoang/Nim/blame/tests/accept/run/tfinally.nim?h=devel&id=cbee9c4e1a1252e6c809d25a0ef371ddee3fc802'>^
bfef39246 ^

e80465dac ^
bfef39246 ^
0a57f662f ^


d34f95d19 ^
0a57f662f ^
e80465dac ^
ca3a4ce67 ^
0a57f662f ^
2cdfe35e7 ^
ca3a4ce67 ^
2cdfe35e7 ^
7cbab4964 ^














bcda71a8a ^















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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

                      






                 




           
   
   

                               
                
      


              
                  
              
          
                
            
 
                            
 














                                            















                                          
discard """
  file: "tfinally.nim"
  output: '''came
here
3
msg1
msg2
finally2
finally1
-----------
except1
finally1
except2
finally2
'''
"""
# Test return in try statement:

proc main: int =
  try:
    try:
      return 1
    finally:
      echo("came")
      return 2
  finally:
    echo("here")
    return 3

echo main() #OUT came here 3

#bug 7204
proc nested_finally =
  try:
    raise newException(KeyError, "msg1")
  except KeyError as ex:
    echo ex.msg
    try:
      raise newException(ValueError, "msg2")
    except:
      echo getCurrentExceptionMsg()
    finally:
      echo "finally2"
  finally:
    echo "finally1"

nested_finally()

echo "-----------"
#bug 7414
try:
  try:
    raise newException(Exception, "Hello")
  except:
    echo "except1"
    raise
  finally:
    echo "finally1"
except:
  echo "except2"
finally:
  echo "finally2"