From fd8c6d0a32d616c7080ba8161d1acd0f2fb74468 Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Fri, 10 Apr 2015 16:12:54 +0300 Subject: Fix deprecation warnings in re --- lib/impure/re.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/impure/re.nim') 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], -- cgit 1.4.1-2-gfad0 m?h=devel&id=f9d4e39a12238d48cd7b8ab461055fe48b989967'>commit diff stats
path: root/compiler/nimsets.nim
blob: 118046283cc873b5d9da2a6170d184d122b9b692 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12