aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2001-07-02 16:42:49 +0000
committerFredrik Lundh <fredrik@pythonware.com>2001-07-02 16:42:49 +0000
commitb0f05bdfd367a6bbcc1d47c3daa3359e7308e7b9 (patch)
treea0a6e90b68843ea0643fa2c5d0e9ccf9a22b3d23 /Modules/sre.h
parentAdded the new unicode defines. Not really tested yet, but Python compiles aga... (diff)
downloadcpython-b0f05bdfd367a6bbcc1d47c3daa3359e7308e7b9.tar.gz
cpython-b0f05bdfd367a6bbcc1d47c3daa3359e7308e7b9.tar.bz2
cpython-b0f05bdfd367a6bbcc1d47c3daa3359e7308e7b9.zip
merged with pythonware's SRE 2.1.1 codebase
Diffstat (limited to 'Modules/sre.h')
-rw-r--r--Modules/sre.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/sre.h b/Modules/sre.h
index 632f47efcae..365eedbac48 100644
--- a/Modules/sre.h
+++ b/Modules/sre.h
@@ -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 */