clean up old codes (#17071)

This commit is contained in:
flywind 2021-02-17 12:26:08 -06:00 • committed by GitHub
commit 8d63f7b483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 11 deletions

View file

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

View file

@ -113,10 +113,7 @@ proc xmlCheckedTag*(argsList: NimNode, tag: string, optAttr = "", reqAttr = "",
result.add(newStrLitNode("</")) result.add(newStrLitNode("</"))
result.add(newStrLitNode(tag)) result.add(newStrLitNode(tag))
result.add(newStrLitNode(">")) result.add(newStrLitNode(">"))
when compiles(nestList(ident"&", result)): result = nestList(ident"&", result)
result = nestList(ident"&", result)
else:
result = nestList(!"&", result)
macro a*(e: varargs[untyped]): untyped = macro a*(e: varargs[untyped]): untyped =
## Generates the HTML ``a`` element. ## Generates the HTML ``a`` element.

View file

@ -686,7 +686,7 @@ macro check*(conditions: untyped): untyped =
result.printOuts.add getAst(print(argStr, callVar)) result.printOuts.add getAst(print(argStr, callVar))
if exp[i].kind == nnkExprEqExpr: if exp[i].kind == nnkExprEqExpr:
# ExprEqExpr # ExprEqExpr
# Ident !"v" # Ident "v"
# IntLit 2 # IntLit 2
result.check[i] = exp[i][1] result.check[i] = exp[i][1]
if exp[i].typeKind notin {ntyTypeDesc}: if exp[i].typeKind notin {ntyTypeDesc}: