support par expression as checkpoint (#15802)

This commit is contained in:
flywind
2020-10-31 17:05:01 +08:00
committed by GitHub
parent bc9a521270
commit 8115b655e7

View File

@@ -641,7 +641,7 @@ macro check*(conditions: untyped): untyped =
let paramAst = exp[i]
if exp[i].kind == nnkIdent:
result.printOuts.add getAst(print(argStr, paramAst))
if exp[i].kind in nnkCallKinds + {nnkDotExpr, nnkBracketExpr}:
if exp[i].kind in nnkCallKinds + {nnkDotExpr, nnkBracketExpr, nnkPar}:
let callVar = newIdentNode(":c" & $counter)
result.assigns.add getAst(asgn(callVar, paramAst))
result.check[i] = callVar