diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-03-19 12:48:46 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-03-19 12:48:54 +0100 |
commit | cd9caf09d1878141871d46a5110648b119b7cb31 (patch) | |
tree | 6535c7cc53afc4dbe18026574076c63972d423c2 /lib/impure/re.nim | |
parent | d3df1b8edaf22101bc7205cb8bb0a661ee3278a2 (diff) | |
download | Nim-cd9caf09d1878141871d46a5110648b119b7cb31.tar.gz |
pcre.nim: added pcre_free and removed hacks in nre and re.nim
Diffstat (limited to 'lib/impure/re.nim')
-rw-r--r-- | lib/impure/re.nim | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/impure/re.nim b/lib/impure/re.nim index 4f32cd5fb..6f57185e6 100644 --- a/lib/impure/re.nim +++ b/lib/impure/re.nim @@ -60,12 +60,9 @@ proc rawCompile(pattern: string, flags: cint): ptr Pcre = raiseInvalidRegex($msg & "\n" & pattern & "\n" & spaces(offset) & "^\n") proc finalizeRegEx(x: Regex) = - # XXX This is a hack, but PCRE does not export its "free" function properly. - # Sigh. The hack relies on PCRE's implementation (see ``pcre_get.c``). - # Fortunately the implementation is unlikely to change. - pcre.free_substring(cast[cstring](x.h)) + pcre.free(x.h) if not isNil(x.e): - pcre.free_substring(cast[cstring](x.e)) + pcre.free_study(x.e) proc re*(s: string, flags = {reStudy}): Regex = ## Constructor of regular expressions. |