mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
implemented macros.getImpl
This commit is contained in:
20
tests/macros/tgetimpl.nim
Normal file
20
tests/macros/tgetimpl.nim
Normal file
@@ -0,0 +1,20 @@
|
||||
discard """
|
||||
msg: '''"muhaha"
|
||||
proc poo(x, y: int) =
|
||||
echo ["poo"]'''
|
||||
"""
|
||||
|
||||
import macros
|
||||
|
||||
const
|
||||
foo = "muhaha"
|
||||
|
||||
proc poo(x, y: int) =
|
||||
echo "poo"
|
||||
|
||||
macro m(x: typed): untyped =
|
||||
echo repr x.symbol.getImpl
|
||||
result = x
|
||||
|
||||
discard m foo
|
||||
discard m poo
|
||||
Reference in New Issue
Block a user