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:
parent
fdc6b0fb6e
commit
de4b0346bd
26 changed files with 176 additions and 65 deletions
|
|
@ -184,10 +184,12 @@ proc transformVarSection(c: PTransf, v: PNode): PNode =
|
|||
if it.kind == nkCommentStmt:
|
||||
result[i] = it
|
||||
elif it.kind == nkIdentDefs:
|
||||
if it[0].kind == nkSym:
|
||||
var vn = it[0]
|
||||
if vn.kind == nkPragmaExpr: vn = vn[0]
|
||||
if vn.kind == nkSym:
|
||||
internalAssert(c.graph.config, it.len == 3)
|
||||
let x = freshVar(c, it[0].sym)
|
||||
idNodeTablePut(c.transCon.mapping, it[0].sym, x)
|
||||
let x = freshVar(c, vn.sym)
|
||||
idNodeTablePut(c.transCon.mapping, vn.sym, x)
|
||||
var defs = newTransNode(nkIdentDefs, it.info, 3)
|
||||
if importantComments(c.graph.config):
|
||||
# keep documentation information:
|
||||
|
|
@ -1036,7 +1038,7 @@ proc transform(c: PTransf, n: PNode): PNode =
|
|||
result = transformAsgn(c, n)
|
||||
of nkIdentDefs, nkConstDef:
|
||||
result = newTransNode(n)
|
||||
result[0] = transform(c, n[0])
|
||||
result[0] = transform(c, skipPragmaExpr(n[0]))
|
||||
# Skip the second son since it only contains an unsemanticized copy of the
|
||||
# variable type used by docgen
|
||||
let last = n.len-1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue