mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-17 14:31:15 +00:00
make quote ast a ref type (#5246)
* make quote ast a ref type * recursive set flag isRef for quoted ast
This commit is contained in:
committed by
Andreas Rumpf
parent
b85898cd41
commit
130f30ddb2
@@ -401,6 +401,11 @@ template handleJmpBack() {.dirty.} =
|
||||
globalError(c.debug[pc], errTooManyIterations)
|
||||
dec(c.loopIterations)
|
||||
|
||||
proc recSetFlagIsRef(arg: PNode) =
|
||||
arg.flags.incl(nfIsRef)
|
||||
for i in 0 ..< arg.safeLen:
|
||||
arg.sons[i].recSetFlagIsRef
|
||||
|
||||
proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
var pc = start
|
||||
var tos = tos
|
||||
@@ -926,6 +931,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
macroCall.add(newSymNode(prc))
|
||||
for i in 1 .. rc-1: macroCall.add(regs[rb+i].regToNode)
|
||||
let a = evalTemplate(macroCall, prc, genSymOwner)
|
||||
a.recSetFlagIsRef
|
||||
ensureKind(rkNode)
|
||||
regs[ra].node = a
|
||||
of opcTJmp:
|
||||
|
||||
Reference in New Issue
Block a user