Merge pull request #3036 from nanoant/patch/macros-sametype
macros: Introduce sameType(a, b) for node types
This commit is contained in:
commit
e38a989a6f
6 changed files with 54 additions and 3 deletions
|
|
@ -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`.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue