Skip to content

Commit

Permalink
Fixed issue #3, changed code to work with new re2 api.
Browse files Browse the repository at this point in the history
  • Loading branch information
axiak committed Jul 15, 2011
1 parent 30e5296 commit 81c612c
Show file tree
Hide file tree
Showing 4 changed files with 1,462 additions and 1,346 deletions.
3 changes: 3 additions & 0 deletions CHANGELIST
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.2.12)
- Fixed pyre2 to work with latest version of re2 (axiak) (issue #3)

0.2.10) 2010-12-08
- Added .flags to pattern to make that transparent (axiak)
- Added Python re unit tests (itsadok)
Expand Down
7 changes: 3 additions & 4 deletions src/_re2.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ cdef extern from "re2/stringpiece.h" namespace "re2":
const_char_ptr data()
int copy(char * buf, size_t n, size_t pos)
int length()


ctypedef StringPiece const_StringPiece "const StringPiece"

Expand Down Expand Up @@ -97,8 +96,8 @@ cdef extern from "re2/re2.h" namespace "re2":
cdef cppclass RE2:
RE2(const_StringPiece pattern, Options option)
RE2(const_StringPiece pattern)
int Match(const_StringPiece text, int startpos, Anchor anchor,
StringPiece * match, int nmatch) nogil
int Match(const_StringPiece text, int startpos, int endpos,
Anchor anchor, StringPiece * match, int nmatch) nogil
int NumberOfCapturingGroups()
int ok()
const_string pattern()
Expand All @@ -113,7 +112,7 @@ cdef extern from "re2/re2.h" namespace "re2":
# issues.
cdef extern from "_re2macros.h":
StringPiece * new_StringPiece_array(int) nogil
void delete_StringPiece_array(StringPiece* ptr)
void delete_StringPiece_array(StringPiece* ptr)

# This fixes the bug Cython #548 whereby reference returns
# cannot be addressed, due to it not being an l-value
Expand Down
Loading

0 comments on commit 81c612c

Please sign in to comment.