diff options
author | Oleh Prypin <blaxpirit@gmail.com> | 2015-04-10 16:12:54 +0300 |
---|---|---|
committer | Oleh Prypin <blaxpirit@gmail.com> | 2015-04-10 16:12:54 +0300 |
commit | fd8c6d0a32d616c7080ba8161d1acd0f2fb74468 (patch) | |
tree | 36c2b08596289b3eb2c70d6389b340a925156f35 /lib/impure/re.nim | |
parent | 7d06fc2165b837a84a91561754a0b3e86a8a0465 (diff) | |
download | Nim-fd8c6d0a32d616c7080ba8161d1acd0f2fb74468.tar.gz |
Fix deprecation warnings in re
Diffstat (limited to 'lib/impure/re.nim')
-rw-r--r-- | lib/impure/re.nim | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/impure/re.nim b/lib/impure/re.nim index 91381bda3..e6fc93c7a 100644 --- a/lib/impure/re.nim +++ b/lib/impure/re.nim @@ -41,11 +41,11 @@ type reExtended = 3, ## ignore whitespace and ``#`` comments reStudy = 4 ## study the expression (may be omitted if the ## expression will be used only once) - - RegexDesc = object - h: PPcre - e: ptr TExtra - + + RegexDesc = object + h: ptr Pcre + e: ptr ExtraData + Regex* = ref RegexDesc ## a compiled regular expression RegexError* = object of ValueError @@ -60,7 +60,7 @@ proc raiseInvalidRegex(msg: string) {.noinline, noreturn.} = e.msg = msg raise e -proc rawCompile(pattern: string, flags: cint): PPcre = +proc rawCompile(pattern: string, flags: cint): ptr Pcre = var msg: cstring offset: cint @@ -84,7 +84,7 @@ proc re*(s: string, flags = {reExtended, reStudy}): Regex = result.h = rawCompile(s, cast[cint](flags - {reStudy})) if reStudy in flags: var msg: cstring - result.e = pcre.study(result.h, 0, msg) + result.e = pcre.study(result.h, 0, addr msg) if not isNil(msg): raiseInvalidRegex($msg) proc matchOrFind(s: string, pattern: Regex, matches: var openArray[string], |