merged with pythonware's SRE 2.1.1 codebase

This commit is contained in:
Fredrik Lundh 2001-07-02 16:42:49 +00:00
parent 4542897d96
commit b0f05bdfd3
2 changed files with 98 additions and 5 deletions

View file

@ -3,7 +3,7 @@
*
* regular expression matching engine
*
* Copyright (c) 1997-2000 by Secret Labs AB. All rights reserved.
* Copyright (c) 1997-2001 by Secret Labs AB. All rights reserved.
*
* See the _sre.c file for information on usage and redistribution.
*/
@ -21,15 +21,18 @@
#define SRE_CODE unsigned short
#endif
#define SRE_CODE unsigned short
typedef struct {
PyObject_VAR_HEAD
int groups;
int groups; /* must be first! */
PyObject* groupindex;
PyObject* indexgroup;
/* compatibility */
PyObject* pattern; /* pattern source (or None) */
int flags; /* flags used when compiling pattern source */
/* pattern code */
int codesize;
SRE_CODE code[1];
} PatternObject;
@ -37,7 +40,7 @@ typedef struct {
typedef struct {
PyObject_VAR_HEAD
PyObject* string; /* link to the target string */
PyObject* string; /* link to the target string (must be first) */
PyObject* regs; /* cached list of matching spans */
PatternObject* pattern; /* link to the regex (pattern) object */
int pos, endpos; /* current target slice */