Hi Hackers,
Inside of rather complicated macro that works on typed proc definition I am analyzing the procs body.
Is there a reliable way to make the distinction?
I was thinking of adding to macros module:
proc owner*(n: NimNode): NimNode {.magic: "SymOwner".}
## n should be a symbol
@Araq, Do you think it good idea?
Thanks
I'm not sure if the following works:
proc owner*(n: NimNode{nkSym}): NimNode = discard
Probably this would be better, as it is done in macros.nim
proc owner*(n:NimNode): NimNode=
n.expectKind nnkSym
I don't know how to check for whether it is a global/local or scope symbol.