store full definition AST for consts, fix noRewrite (#20115)

* continue #9582 for consts, close #9331, fix #20114

also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc

* changelog correctly

* fix jsgen

* update tgetimpl

* fix sighashes

* fix #19766, add comment about postfix

* fix noRewrite LOL

refs #16620

* fix changelog

* fix destructors
This commit is contained in:
metagn 2022-09-28 16:05:01 +03:00 • committed by GitHub
commit de4b0346bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 176 additions and 65 deletions

View file

@ -1101,12 +1101,13 @@ proc track(tracked: PEffects, n: PNode) =
for i in 0..<child.len-2:
createTypeBoundOps(tracked, child[i].typ, child.info)
else:
createTypeBoundOps(tracked, child[0].typ, child.info)
createTypeBoundOps(tracked, skipPragmaExpr(child[0]).typ, child.info)
if child.kind == nkIdentDefs and last.kind != nkEmpty:
for i in 0..<child.len-2:
initVar(tracked, child[i], volatileCheck=false)
addAsgnFact(tracked.guards, child[i], last)
notNilCheck(tracked, last, child[i].typ)
let a = skipPragmaExpr(child[i])
initVar(tracked, a, volatileCheck=false)
addAsgnFact(tracked.guards, a, last)
notNilCheck(tracked, last, a.typ)
elif child.kind == nkVarTuple and last.kind != nkEmpty:
for i in 0..<child.len-1:
if child[i].kind == nkEmpty or