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:
Zahary Karadjov 2011-11-16 02:18:10 +02:00
commit 12bac28d23
6 changed files with 119 additions and 36 deletions

View file

@ -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.} =