enable,document,test getImplTransformed, very useful for understanding how nim transforms code (#14924)
* enable,document,test getImplTransformed, very useful for understanding how nim transforms code
This commit is contained in:
parent
c983466c15
commit
169ca37d26
2 changed files with 25 additions and 2 deletions
|
|
@ -277,9 +277,12 @@ else: # bootstrapping substitute
|
|||
|
||||
{.pop.}
|
||||
|
||||
when defined(nimSymImplTransform):
|
||||
when (NimMajor, NimMinor, NimPatch) >= (1, 3, 5) or defined(nimSymImplTransform):
|
||||
proc getImplTransformed*(symbol: NimNode): NimNode {.magic: "GetImplTransf", noSideEffect.}
|
||||
## For a typed proc returns the AST after transformation pass.
|
||||
## For a typed proc returns the AST after transformation pass; this is useful
|
||||
## for debugging how the compiler transforms code (eg: `defer`, `for`) but
|
||||
## note that code transformations are implementation dependent and subject to change.
|
||||
## See an example in `tests/macros/tmacros_various.nim`.
|
||||
|
||||
when defined(nimHasSymOwnerInMacro):
|
||||
proc owner*(sym: NimNode): NimNode {.magic: "SymOwner", noSideEffect.}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue