mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 14:25:23 +00:00
pegs.findAll iterator fix
Modified the findAll iterator so that it continues looking for a match within the input string (bug?).
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user