From 8d63f7b4831ccdadc3f119526b5b82db064aade7 Mon Sep 17 00:00:00 2001 From: flywind <43030857+xflywind@users.noreply.github.com> Date: Wed, 17 Feb 2021 12:26:08 -0600 Subject: [PATCH] clean up old codes (#17071) --- compiler/guards.nim | 7 +------ lib/pure/htmlgen.nim | 5 +---- lib/pure/unittest.nim | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/compiler/guards.nim b/compiler/guards.nim index 4a7a5f2841..0281421276 100644 --- a/compiler/guards.nim +++ b/compiler/guards.nim @@ -774,12 +774,7 @@ macro `=~`(x: PNode, pat: untyped): bool = var conds = newTree(nnkBracket) m(x, pat, conds) - when compiles(nestList(ident"and", conds)): - result = nestList(ident"and", conds) - #elif declared(macros.toNimIdent): - # result = nestList(toNimIdent"and", conds) - else: - result = nestList(!"and", conds) + result = nestList(ident"and", conds) proc isMinusOne(n: PNode): bool = n.kind in {nkCharLit..nkUInt64Lit} and n.intVal == -1 diff --git a/lib/pure/htmlgen.nim b/lib/pure/htmlgen.nim index acec058323..7bff697747 100644 --- a/lib/pure/htmlgen.nim +++ b/lib/pure/htmlgen.nim @@ -113,10 +113,7 @@ proc xmlCheckedTag*(argsList: NimNode, tag: string, optAttr = "", reqAttr = "", result.add(newStrLitNode("")) - when compiles(nestList(ident"&", result)): - result = nestList(ident"&", result) - else: - result = nestList(!"&", result) + result = nestList(ident"&", result) macro a*(e: varargs[untyped]): untyped = ## Generates the HTML ``a`` element. diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index 21087e8ef7..d1b71b1b7c 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -686,7 +686,7 @@ macro check*(conditions: untyped): untyped = result.printOuts.add getAst(print(argStr, callVar)) if exp[i].kind == nnkExprEqExpr: # ExprEqExpr - # Ident !"v" + # Ident "v" # IntLit 2 result.check[i] = exp[i][1] if exp[i].typeKind notin {ntyTypeDesc}: