macros.nim: deprecated ! operator

This commit is contained in:
Andreas Rumpf 2017-11-19 10:08:24 +01:00
commit 4f9e8cf313
2 changed files with 15 additions and 7 deletions

View file

@ -768,8 +768,10 @@ macro `=~`(x: PNode, pat: untyped): bool =
var conds = newTree(nnkBracket)
m(x, pat, conds)
result = nestList(!"and", conds)
when declared(macros.toNimIdent):
result = nestList(toNimIdent"and", conds)
else:
result = nestList(!"and", conds)
proc isMinusOne(n: PNode): bool =
n.kind in {nkCharLit..nkUInt64Lit} and n.intVal == -1