summary refs log blame commit diff stats
path: root/tests/macros/tvarnimnode.nim
blob: ab0f66caab8cc93131334d68e3fb65014c30ec78 (plain) (tree)
1
2
3
4
5
6
7
8
9







             
                                           









                                                 
discard """
  output: 10
"""

#bug #926

import macros

proc test(f: var NimNode) {.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