m1.nim 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import ./m2
  2. import ./m3 {.all.} as m3
  3. from ./m3 as m3Bis import nil
  4. doAssert m3h2 == 2
  5. export m3h2
  6. export m3Bis.m3p1
  7. const foo0* = 2
  8. const foo1 = bar1
  9. const foo1Aux = 2
  10. export foo1Aux
  11. doAssert not declared(bar2)
  12. doAssert not compiles(bar2)
  13. var foo2 = 2
  14. let foo3 = 2
  15. type Foo4 = enum
  16. kg1, kg2
  17. type Foo4b {.pure.} = enum
  18. foo4b1, foo4b2
  19. type Foo5 = object
  20. z1: string
  21. z2: Foo4
  22. z3: int
  23. z4*: int
  24. proc `z3`*(a: Foo5): auto =
  25. a.z3 * 10
  26. proc foo6(): auto = 2
  27. proc foo6b*(): auto = 2
  28. template foo7: untyped = 2
  29. macro foo8(): untyped = discard
  30. template foo9(a: int) = discard
  31. block:
  32. template foo10: untyped = 2
  33. type Foo11 = enum
  34. kg1b, kg2b
  35. proc foo12(): auto = 2
  36. proc initFoo5*(z3: int): Foo5 = Foo5(z3: z3)
  37. func foo13(): auto = 2
  38. iterator foo14a(): int = discard
  39. iterator foo14b*(): int = discard
  40. iterator foo14c(): int {.closure.} = discard
  41. iterator foo14d(): int {.inline.} = discard
  42. # fwd declare
  43. proc foo15(): int
  44. proc foo15(): int = 2
  45. proc foo16*(): int
  46. proc foo16(): int = 2
  47. proc foo17*(): int
  48. proc foo17*(): int = 2
  49. # other
  50. type A1 = distinct int
  51. type A2 = distinct int
  52. converter foo18(x: A1): A2 = discard