From a03d178a561e50259465ba8b8e9972fad73e9dbc Mon Sep 17 00:00:00 2001 From: Flaviu Tamas Date: Thu, 15 Jan 2015 19:53:31 -0500 Subject: [PATCH] Implement capture iterator --- src/nre.nim | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/nre.nim b/src/nre.nim index f5eaaf4180..1c803f27fd 100644 --- a/src/nre.nim +++ b/src/nre.nim @@ -156,20 +156,25 @@ proc asTable*(pattern: CaptureBounds, default = None[Slice[int]]()): result = initTable[string, Option[Slice[int]]]() asTableImpl(nextVal.isNone) -template toSeqImpl(cond: bool): stmt {.immediate, dirty.} = - result = @[] +template itemsImpl(cond: bool): stmt {.immediate, dirty.} = for i in 0 ..