further steps to closure support

This commit is contained in:
Araq 2012-02-06 00:19:56 +01:00
commit 632aece191
20 changed files with 379 additions and 138 deletions

View file

@ -644,8 +644,6 @@ proc semLambda(c: PContext, n: PNode): PNode =
else:
s.typ = newTypeS(tyProc, c)
addSon(s.typ, nil)
# no! do a proper analysis to determine calling convention
when false: s.typ.callConv = ccClosure
if n.sons[pragmasPos].kind != nkEmpty:
pragma(c, s, n.sons[pragmasPos], lambdaPragmas)
s.options = gOptions
@ -697,9 +695,6 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
# open for parameters
if proto == nil:
s.typ.callConv = lastOptionEntry(c).defaultCC
when false:
# do a proper analysis here:
if c.p.owner.kind != skModule: s.typ.callConv = ccClosure
# add it here, so that recursive procs are possible:
# -2 because we have a scope open for parameters
if kind in OverloadableSyms: