mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
20 lines
280 B
Nim
20 lines
280 B
Nim
import macros
|
|
|
|
proc testProc: string {.compileTime.} =
|
|
result = ""
|
|
result = result & ""
|
|
|
|
when true:
|
|
macro test(n: stmt): stmt {.immediate.} =
|
|
result = newNimNode(nnkStmtList)
|
|
echo "#", testProc(), "#"
|
|
test:
|
|
"hi"
|
|
|
|
const
|
|
x = testProc()
|
|
|
|
echo "##", x, "##"
|
|
|
|
|