mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
25 lines
346 B
Nim
25 lines
346 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, "##"
|
|
|
|
# bug #1310
|
|
static:
|
|
var i, j: set[int8] = {}
|
|
var k = i + j
|
|
|
|
|