next steps to hygienic templates

This commit is contained in:
Araq 2012-08-20 08:44:17 +02:00
commit da190876de
17 changed files with 97 additions and 76 deletions

View file

@ -96,8 +96,7 @@ proc getCurrOwner(c: PTransf): PSym =
else: result = c.module
proc newTemp(c: PTransf, typ: PType, info: TLineInfo): PSym =
result = newSym(skTemp, getIdent(genPrefix), getCurrOwner(c))
result.info = info
result = newSym(skTemp, getIdent(genPrefix), getCurrOwner(c), info)
result.typ = skipTypes(typ, {tyGenericInst})
incl(result.flags, sfFromGeneric)
@ -205,9 +204,8 @@ proc hasContinue(n: PNode): bool =
if hasContinue(n.sons[i]): return true
proc newLabel(c: PTransf, n: PNode): PSym =
result = newSym(skLabel, nil, getCurrOwner(c))
result = newSym(skLabel, nil, getCurrOwner(c), n.info)
result.name = getIdent(genPrefix & $result.id)
result.info = n.info
proc transformBlock(c: PTransf, n: PNode): PTransNode =
var labl: PSym