Nim/tests/compile/tmacro1.nim
2011-11-19 15:45:51 +01:00

21 lines
281 B
Nim
Executable file

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"