Merge pull request #3036 from nanoant/patch/macros-sametype

macros: Introduce sameType(a, b) for node types
This commit is contained in:
Andreas Rumpf 2015-07-04 16:12:09 +02:00
commit e38a989a6f
6 changed files with 54 additions and 3 deletions

View file

@ -144,6 +144,10 @@ proc `==`*(a, b: NimIdent): bool {.magic: "EqIdent", noSideEffect.}
proc `==`*(a, b: NimNode): bool {.magic: "EqNimrodNode", noSideEffect.}
## compares two Nim nodes
proc sameType*(a, b: NimNode): bool {.magic: "SameNodeType", noSideEffect.}
## compares two Nim nodes' types. Return true if the types are the same,
## eg. true when comparing alias with original type.
proc len*(n: NimNode): int {.magic: "NLen", noSideEffect.}
## returns the number of children of `n`.