macros and templates can be expanded anywhere where a type is expected.
This allows for various type selection algorithms to be implemented. See tests / accept / compile / ttypeselectors.nim for examples.
This commit is contained in:
parent
ecd3c80e7e
commit
12bac28d23
6 changed files with 119 additions and 36 deletions
|
|
@ -633,6 +633,12 @@ proc copyNode*(src: PNode): PNode
|
|||
proc copyTree*(src: PNode): PNode
|
||||
# does copy its sons!
|
||||
|
||||
const nkCallKinds* = {nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand,
|
||||
nkCallStrLit}
|
||||
|
||||
proc isCallExpr*(n: PNode): bool =
|
||||
result = n.kind in nkCallKinds
|
||||
|
||||
proc discardSons*(father: PNode)
|
||||
|
||||
proc len*(n: PNode): int {.inline.} =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue