mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
merged with pythonware's SRE 2.1.1 codebase
This commit is contained in:
parent
4542897d96
commit
b0f05bdfd3
2 changed files with 98 additions and 5 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue