X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=regexp.h;h=04932670fc90604b62a5650917bf6c134373abc2;hb=a86fbd4f9d493275993c0370a0246611dbcffc30;hp=0491d347c11f1e349ce6cafd9d51c9f77fe6a70a;hpb=3b0527feddb0a07bea3ee32931f209fea87152bc;p=p5sagit%2Fp5-mst-13.2.git diff --git a/regexp.h b/regexp.h index 0491d34..0493267 100644 --- a/regexp.h +++ b/regexp.h @@ -184,7 +184,6 @@ typedef enum { resume_CURLYM1, resume_CURLYM2, resume_CURLYM3, - resume_CURLYM4, resume_IFMATCH, resume_PLUS1, resume_PLUS2, @@ -214,20 +213,26 @@ typedef struct regmatch_state { I32 ln; /* len or last */ union { + + /* this is a fake union member that matches the first element + * of each member that needs to store positive backtrack + * information */ + struct { + struct regmatch_state *prev_yes_state; + } yes; + struct { reg_trie_accepted *accept_buff; U32 accepted; /* how many accepting states we have seen */ } trie; struct { + /* this first element must match u.yes */ + struct regmatch_state *prev_yes_state; regexp *prev_rex; int toggleutf; CHECKPOINT cp; /* remember current savestack indexes */ CHECKPOINT lastcp; - struct regmatch_state *prev_eval; /* save cur_eval */ - struct regmatch_slab *prev_slab; - int depth; - } eval; struct { @@ -254,12 +259,15 @@ typedef struct regmatch_state { } whilem; struct { + /* this first element must match u.yes */ + struct regmatch_state *prev_yes_state; I32 paren; I32 c1, c2; /* case fold search */ CHECKPOINT lastcp; I32 l; I32 matches; I32 maxwanted; + bool minmod; } curlym; struct { @@ -270,6 +278,12 @@ typedef struct regmatch_state { char *old; int count; } plus; /* and CURLYN/CURLY/STAR */ + + struct { + /* this first element must match u.yes */ + struct regmatch_state *prev_yes_state; + I32 wanted; + } ifmatch; /* and SUSPEND/UNLESSM */ } u; } regmatch_state;