mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
17 lines
233 B
Nim
17 lines
233 B
Nim
import macros
|
|
|
|
template baz() =
|
|
proc bar() =
|
|
var x = 5
|
|
iterator foo(): int {.closure.} =
|
|
echo x
|
|
var y = foo
|
|
discard y()
|
|
|
|
macro test(): untyped =
|
|
result = getAst(baz())
|
|
echo(treeRepr(result))
|
|
|
|
test()
|
|
bar()
|