diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-07-04 16:12:09 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-07-04 16:12:09 +0200 |
commit | e38a989a6f84fdc245cb57e44143007d4e37eefa (patch) | |
tree | d3df612b9f4fce0103c3c86fa68063cd8cdcd200 /lib | |
parent | b39ce2fbfc8b2fcebcbdfb22d3c858368916934e (diff) | |
parent | 1a0417fbe0d2fe61c05a68f14858b0da0e596c02 (diff) | |
download | Nim-e38a989a6f84fdc245cb57e44143007d4e37eefa.tar.gz |
Merge pull request #3036 from nanoant/patch/macros-sametype
macros: Introduce sameType(a, b) for node types
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core/macros.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index 044020b2a..49def06f0 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -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`. |