From 1465a7b08096d825f77a85e5594266d78ff022a9 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 23 Jan 2014 12:22:34 +0100 Subject: [PATCH] small code cleanups --- compiler/ast.nim | 1 - compiler/lambdalifting.nim | 4 +--- web/news.txt | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 82cc2c96f..0e351a31a 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -287,7 +287,6 @@ const sfNoRoot* = sfBorrow # a local variable is provably no root so it doesn't # require RC ops - sfClosureCreated* = sfDiscriminant # for transf-lambdalifting interaction const # getting ready for the future expr/stmt merge diff --git a/compiler/lambdalifting.nim b/compiler/lambdalifting.nim index a9c4a8757..01eb49463 100644 --- a/compiler/lambdalifting.nim +++ b/compiler/lambdalifting.nim @@ -422,7 +422,6 @@ proc transformOuterConv(n: PNode): PNode = proc makeClosure(prc, env: PSym, info: TLineInfo): PNode = result = newNodeIT(nkClosure, info, prc.typ) result.add(newSymNode(prc)) - if prc.kind == skIterator: incl(prc.flags, sfClosureCreated) if env == nil: result.add(newNodeIT(nkNilLit, info, getSysType(tyNil))) else: @@ -776,8 +775,7 @@ proc liftIterSym*(n: PNode): PNode = # transforms (iter) to (let env = newClosure[iter](); (iter, env)) let iter = n.sym assert iter.kind == skIterator - #if sfClosureCreated in iter.flags: return n - + result = newNodeIT(nkStmtListExpr, n.info, n.typ) var env = copySym(getHiddenParam(iter)) diff --git a/web/news.txt b/web/news.txt index 01b6d18b9..a045eb880 100644 --- a/web/news.txt +++ b/web/news.txt @@ -74,6 +74,8 @@ Language Additions evaluable at compile-time. - Support for user-defined type classes has been added. - The *command syntax* is supported in a lot more contexts. +- Anonymous iterators are now supported and iterators can capture variables + of an outer proc. Tools improvements