From 6621454dec0492044f76d1c78e9df7682048b83b Mon Sep 17 00:00:00 2001 From: Fabio Cevasco Date: Fri, 21 Feb 2014 14:14:43 +0100 Subject: pegs.findAll iterator fix Modified the findAll iterator so that it continues looking for a match within the input string (bug?). --- lib/pure/pegs.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index 70b617393..3b1516e17 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -836,7 +836,9 @@ iterator findAll*(s: string, pattern: TPeg, start = 0): string = while i < s.len: c.ml = 0 var L = rawMatch(s, pattern, i, c) - if L < 0: break + if L < 0: + inc(i, 1) + continue yield substr(s, i, i+L-1) inc(i, L) -- cgit 1.4.1-2-gfad0 ption> Chawan - a web browser for your terminal (mirror)ahoang <ahoang@tilde.institute>
about summary refs log blame commit diff stats
path: root/src/layout/engine.nim
blob: fe912174a8f79ca432d42e5ff6bd1ec523317208 (plain) (tree)
1
2
3
4
5
6
7
8
9