mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Implemented non-recursive SRE matching.
This commit is contained in:
parent
41e2809feb
commit
ad3fc44ccb
9 changed files with 844 additions and 474 deletions
|
|
@ -55,6 +55,7 @@ typedef unsigned int (*SRE_TOLOWER_HOOK)(unsigned int ch);
|
|||
typedef struct SRE_REPEAT_T {
|
||||
int count;
|
||||
SRE_CODE* pattern; /* points to REPEAT operator arguments */
|
||||
void* last_ptr; /* helper to check for infinite loops */
|
||||
struct SRE_REPEAT_T *prev; /* points to previous repeat context */
|
||||
} SRE_REPEAT;
|
||||
|
||||
|
|
@ -74,10 +75,11 @@ typedef struct {
|
|||
int lastmark;
|
||||
void* mark[SRE_MARK_SIZE];
|
||||
/* dynamically allocated stuff */
|
||||
void** mark_stack;
|
||||
int mark_stack_size;
|
||||
int mark_stack_base;
|
||||
SRE_REPEAT *repeat; /* current repeat context */
|
||||
char* data_stack;
|
||||
int data_stack_size;
|
||||
int data_stack_base;
|
||||
/* current repeat context */
|
||||
SRE_REPEAT *repeat;
|
||||
/* hooks */
|
||||
SRE_TOLOWER_HOOK lower;
|
||||
} SRE_STATE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue