mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
19 lines
374 B
Nim
19 lines
374 B
Nim
import macros
|
|
|
|
macro macro_bug*(s: untyped) =
|
|
echo s.treeRepr
|
|
s.expectKind({nnkProcDef, nnkMethodDef})
|
|
|
|
var params = s.params
|
|
|
|
let genericParams = s[2]
|
|
result = newNimNode(nnkProcDef).add(
|
|
s.name, s[1], genericParams, params, pragma(s), newEmptyNode())
|
|
|
|
# don't really do anything
|
|
var body = body(s)
|
|
result.add(body)
|
|
|
|
echo "result:"
|
|
echo result.repr
|