summary refs log tree commit diff stats
path: root/lib/impure/nre.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/impure/nre.nim')
-rw-r--r--lib/impure/nre.nim12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/impure/nre.nim b/lib/impure/nre.nim
index 2c1b1deae..39d238055 100644
--- a/lib/impure/nre.nim
+++ b/lib/impure/nre.nim
@@ -61,12 +61,12 @@ runnableExamples:
   assert find("uxabc", re"(?<=x|y)ab", start = 1).get.captures[-1] == "ab"
   assert find("uxabc", re"ab", start = 3).isNone
 
-from pcre import nil
+from std/pcre import nil
 import nre/private/util
-import tables
-from strutils import `%`
-import options
-from unicode import runeLenAt
+import std/tables
+from std/strutils import `%`
+import std/options
+from std/unicode import runeLenAt
 
 when defined(nimPreviewSlimSystem):
   import std/assertions
@@ -217,9 +217,11 @@ type
     ## code.
 
 proc destroyRegex(pattern: Regex) =
+  `=destroy`(pattern.pattern)
   pcre.free_substring(cast[cstring](pattern.pcreObj))
   if pattern.pcreExtra != nil:
     pcre.free_study(pattern.pcreExtra)
+  `=destroy`(pattern.captureNameToId)
 
 proc getinfo[T](pattern: Regex, opt: cint): T =
   let retcode = pcre.fullinfo(pattern.pcreObj, pattern.pcreExtra, opt, addr result)
href='/ahoang/Nim/commit/lib/posix/epoll.nim?h=devel&id=526f9da46368d9f764783696b4e993c8e1e265f4'>526f9da46 ^
43bddf62d ^



526f9da46 ^
43bddf62d ^
d3394be55 ^
471c0aa63 ^
d3394be55 ^
526f9da46 ^
d3394be55 ^
43bddf62d ^
d3394be55 ^
526f9da46 ^
43bddf62d ^
526f9da46 ^

a7736b6b4 ^



526f9da46 ^
43bddf62d ^
526f9da46 ^

a7736b6b4 ^
526f9da46 ^
d3394be55 ^
526f9da46 ^
a7736b6b4 ^






526f9da46 ^
d3394be55 ^
43bddf62d ^
526f9da46 ^

a7736b6b4 ^





526f9da46 ^
a7736b6b4 ^

526f9da46 ^

d3394be55 ^
526f9da46 ^


a7736b6b4 ^
526f9da46 ^
a7736b6b4 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90