tfinally2.nim 343 B

1234567891011121314151617181920212223242526272829
  1. discard """
  2. output: '''
  3. A
  4. B
  5. C
  6. D
  7. '''
  8. """
  9. # Test break in try statement:
  10. proc main: int =
  11. try:
  12. block AB:
  13. try:
  14. try:
  15. break AB
  16. finally:
  17. echo("A")
  18. echo("skipped")
  19. finally:
  20. block B:
  21. echo("B")
  22. echo("skipped")
  23. echo("C")
  24. finally:
  25. echo("D")
  26. discard main()