summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2015-07-04 16:12:09 +0200
committerAndreas Rumpf <rumpf_a@web.de>2015-07-04 16:12:09 +0200
commite38a989a6f84fdc245cb57e44143007d4e37eefa (patch)
treed3df612b9f4fce0103c3c86fa68063cd8cdcd200 /lib
parentb39ce2fbfc8b2fcebcbdfb22d3c858368916934e (diff)
parent1a0417fbe0d2fe61c05a68f14858b0da0e596c02 (diff)
downloadNim-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.nim4
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`.
 
author Andreas Rumpf <rumpf_a@web.de> 2008-08-23 11:16:44 +0200 committer Andreas Rumpf <rumpf_a@web.de> 2008-08-23 11:16:44 +0200 too many changes to list' href='/ahoang/Nim/commit/data/keywords.txt?h=devel&id=07d5a8085bbcc21a1d9d06a2976ecc00e9c8d55b'>07d5a8085 ^
b961e47bf ^
07d5a8085 ^
c0a3d4406 ^
405b86068
3ccc9c467 ^
405b86068

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20