summary refs log tree commit diff stats
path: root/tests/macros/tvarnimnode.nim
blob: 73fcc16ea96e386499188ea762b47b0fa9349b58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  output: 10
"""

#bug #926

import macros

proc test(f: var PNimrodNode) {.compileTime.} =
  f = newNimNode(nnkStmtList)
  f.add newCall(newIdentNode("echo"), newLit(10))

macro blah(prc: stmt): stmt =
  result = prc

  test(result)

proc test() {.blah.} =
  echo 5