summary refs log tree commit diff stats
path: root/tests/accept/compile/tmacro1.nim
blob: e96997c472b99ca23d446fc5ce01d410ee555063 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import  macros

macro test*(a: stmt): stmt =
  var nodes: tuple[a, b: int]  
  nodes.a = 4
  nodes[1] = 45
  
  type
    TTypeEx = object
      x, y: int
      case b: bool
      of false: nil
      of true: z: float
      
  var t: TTypeEx
  t.b = true
  t.z = 4.5

test:
  "hi"