next steps for first class iterators

This commit is contained in:
Araq 2012-11-26 02:43:32 +01:00
commit dd9ad9e497
7 changed files with 16 additions and 7 deletions

View file

@ -744,11 +744,12 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
rawAddSon(s.typ, nil)
if n.sons[patternPos].kind != nkEmpty:
n.sons[patternPos] = semPattern(c, n.sons[patternPos])
if s.kind == skIterator: s.typ.flags.incl(tfIterator)
var proto = SearchForProc(c, s, c.tab.tos-2) # -2 because we have a scope
# open for parameters
if proto == nil:
s.typ.callConv = lastOptionEntry(c).defaultCC
s.typ.callConv = lastOptionEntry(c).defaultCC
# add it here, so that recursive procs are possible:
# -2 because we have a scope open for parameters
if sfGenSym in s.flags: nil