Adjust re for nre's inclusive bounds

This commit is contained in:
Flaviu Tamas 2015-05-26 19:48:58 -04:00
commit 15ef227c48

View file

@ -97,7 +97,7 @@ template returnBounds(): stmt {.immediate, dirty.} =
return (m.matchBounds.a, <m.matchBounds.b) return (m.matchBounds.a, <m.matchBounds.b)
template returnLength(): stmt {.immediate, dirty.} = template returnLength(): stmt {.immediate, dirty.} =
return m.matchBounds.b - m.matchBounds.a return m.matchBounds.b - m.matchBounds.a + 1
proc findBounds*(s: string, pattern: Regex, matches: var openArray[string], proc findBounds*(s: string, pattern: Regex, matches: var openArray[string],
start = 0): tuple[first, last: int] = start = 0): tuple[first, last: int] =