much simpler implementation of constant tuple declarations

This commit is contained in:
Andreas Rumpf 2018-12-19 11:11:33 +01:00
commit 3300c8a500
4 changed files with 33 additions and 55 deletions

View file

@ -81,8 +81,7 @@ type
nnkState,
nnkBreakState,
nnkFuncDef,
nnkTupleConstr,
nnkConstTuple
nnkTupleConstr
NimNodeKinds* = set[NimNodeKind]
NimTypeKind* = enum # some types are no longer used, see ast.nim
@ -278,9 +277,9 @@ when defined(nimHasSymOwnerInMacro):
when defined(nimHasInstantiationOfInMacro):
proc isInstantiationOf*(instanceProcSym, genProcSym: NimNode): bool {.magic: "SymIsInstantiationOf", noSideEffect.}
## check if proc symbol is instance of the generic proc symbol
## useful to check proc symbols against generic symbols
## useful to check proc symbols against generic symbols
## returned by `bindSym`
proc getType*(n: NimNode): NimNode {.magic: "NGetType", noSideEffect.}
## with 'getType' you can access the node's `type`:idx:. A Nim type is
## mapped to a Nim AST too, so it's slightly confusing but it means the same