tdoc_comments.nim 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # bug #1799
  2. proc MyProc1*() = ## Comment behind procedure
  3. discard
  4. proc MyProc2*() =
  5. ## Comment below procedure
  6. discard
  7. template MyTemplate1*() = discard ## Comment behind template
  8. template MyTemplate2*() = discard
  9. ## Comment below template
  10. const
  11. MyConst1* = 1 ## Comment behind constant
  12. MyConst2* = 2
  13. ## Comment below constant
  14. var
  15. MyVar1* = 1 ## Comment behind variable
  16. MyVar2* = 2
  17. ## Comment below variable
  18. type
  19. MyObject1* = object
  20. ## Comment below declaration
  21. field1*: int ## Comment behind field
  22. field2*: int ## Comment behind field
  23. field3*: int
  24. ## Comment below field
  25. field4*: int
  26. ## Comment below field
  27. MyObject2* = object ## Comment behind declaration
  28. field1*: int
  29. type
  30. MyTuple1* = tuple
  31. ## Comment below declaration
  32. field1: int ## Comment behind field
  33. field2: int ## Comment behind field
  34. field3: int
  35. ## Comment below field
  36. field4: int
  37. ## Comment below field
  38. MyTuple2* = tuple ## Comment behind declaration
  39. field1: int
  40. type
  41. MyEnum1* = enum
  42. ## Comment below declaration
  43. value1, ## Comment behind value
  44. value2,
  45. ## Comment below value with comma
  46. value3
  47. ## Comment below value without comma
  48. MyEnum2* = enum ## Comment behind declaration
  49. value4
  50. MyEnum3* = enum
  51. value5 ## only document the enum value