summaryrefslogtreecommitdiff
path: root/Modules/sre.h
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-06-29 16:57:40 +0000
committerFredrik Lundh <fredrik@pythonware.com>2000-06-29 16:57:40 +0000
commitbe2211e9401a0be96915c473ef99041beb5a4992 (patch)
treeb69453753d4617d7ac4b6b59fcc5a13cc55cd392 /Modules/sre.h
parent69218178ec7f1ed64c1da76e1d5a0ae4a9a2e16b (diff)
downloadcpython-git-be2211e9401a0be96915c473ef99041beb5a4992.tar.gz
- fixed split
(test_sre still complains about split, but that's caused by the group reset bug, not split itself) - added more mark slots (should be dynamically allocated, but 100 is better than 32. and checking for the upper limit is better than overwriting the memory ;-) - internal: renamed the cursor helper class - internal: removed some bloat from sre_compile
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 a7786ede01..722f890499 100644
--- a/Modules/sre.h
+++ b/Modules/sre.h
@@ -46,6 +46,9 @@ typedef struct {
void* ptr;
} SRE_STACK;
+/* FIXME: <fl> shouldn't be a constant, really... */
+#define SRE_MARK_SIZE 200
+
typedef struct {
/* string pointers */
void* ptr; /* current position (also end of current slice) */
@@ -56,7 +59,7 @@ typedef struct {
int charsize;
/* registers */
int lastmark;
- void* mark[64]; /* FIXME: <fl> should be dynamically allocated! */
+ void* mark[SRE_MARK_SIZE];
/* backtracking stack */
SRE_STACK* stack;
int stacksize;
@@ -66,11 +69,11 @@ typedef struct {
} SRE_STATE;
typedef struct {
- /* search helper */
+ /* scanner (internal helper object) */
PyObject_HEAD
PyObject* pattern;
PyObject* string;
SRE_STATE state;
-} CursorObject;
+} ScannerObject;
#endif