absurd_nesting.nim 670 B

123456789101112131415161718192021222324252627282930
  1. # Tries to test the full ownership path generated by idetools.
  2. proc lev1(t1: string) =
  3. var temp = t1
  4. for i in 0..len(temp)-1:
  5. temp[i] = chr(int(temp[i]) + 1)
  6. proc lev2(t2: string) =
  7. var temp = t2
  8. for i in 0..len(temp)-1:
  9. temp[i] = chr(int(temp[i]) + 1)
  10. proc lev3(t3: string) =
  11. var temp = t3
  12. for i in 0..len(temp)-1:
  13. temp[i] = chr(int(temp[i]) + 1)
  14. proc lev4(t4: string) =
  15. var temp = t4
  16. for i in 0..len(temp)-1:
  17. temp[i] = chr(int(temp[i]) + 1)
  18. echo temp & "(lev4)"
  19. lev4(temp & "(lev3)")
  20. lev3(temp & "(lev2)")
  21. lev2(temp & "(lev1)")
  22. when isMainModule:
  23. lev1("abcd")