tv3_outline.nim 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # tests v3 outline
  2. type
  3. Foo* = ref object of RootObj
  4. bar*: string
  5. FooEnum = enum value1, value2
  6. FooPrivate = ref object of RootObj
  7. barPrivate: string
  8. macro m(arg: untyped): untyped = discard
  9. template t(arg: untyped): untyped = discard
  10. proc p(): void = discard
  11. iterator i(): int = discard
  12. converter c(s: string): int = discard
  13. method m(f: Foo): void = discard
  14. func f(): void = discard
  15. let a = 1
  16. var b = 2
  17. const con = 2
  18. proc outer(): void =
  19. proc inner() = discard
  20. proc procWithLocal(): void =
  21. let local = 10
  22. discard """
  23. $nimsuggest --v3 --tester $file
  24. >outline $file
  25. outline skType tv3_outline.Foo Foo $file 4 2 "" 100 5 16
  26. outline skType tv3_outline.FooEnum FooEnum $file 6 2 "" 100 6 31
  27. outline skEnumField tv3_outline.FooEnum.value1 FooEnum $file 6 17 "" 100 6 23
  28. outline skEnumField tv3_outline.FooEnum.value2 FooEnum $file 6 25 "" 100 6 31
  29. outline skType tv3_outline.FooPrivate FooPrivate $file 7 2 "" 100 8 22
  30. outline skMacro tv3_outline.m macro (arg: untyped): untyped{.noSideEffect, gcsafe.} $file 10 6 "" 100 10 40
  31. outline skTemplate tv3_outline.t template (arg: untyped): untyped $file 11 9 "" 100 11 43
  32. outline skProc tv3_outline.p proc (){.noSideEffect, gcsafe.} $file 12 5 "" 100 12 24
  33. outline skConverter tv3_outline.c converter (s: string): int{.noSideEffect, gcsafe.} $file 14 10 "" 100 14 37
  34. outline skFunc tv3_outline.f proc (){.noSideEffect, gcsafe.} $file 16 5 "" 100 16 24
  35. outline skConst tv3_outline.con int literal(2) $file 20 6 "" 100 20 13
  36. outline skProc tv3_outline.outer proc (){.noSideEffect, gcsafe.} $file 22 5 "" 100 23 24
  37. outline skProc tv3_outline.outer.inner proc (){.noSideEffect, gcsafe.} $file 23 7 "" 100 23 24
  38. outline skProc tv3_outline.procWithLocal proc (){.noSideEffect, gcsafe.} $file 25 5 "" 100 26 16
  39. """