Upgrade to Text-Tabs+Wrap-2006.0711. Keep the local changes from
[p5sagit/p5-mst-13.2.git] / regexp.h
index 4ea7c69..8d71752 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -180,34 +180,12 @@ typedef struct {
 
 typedef I32 CHECKPOINT;
 
-typedef enum {
-    resume_TRIE1,
-    resume_TRIE2,
-    resume_EVAL,
-    resume_CURLYX,
-    resume_WHILEM1,
-    resume_WHILEM2,
-    resume_WHILEM3,
-    resume_WHILEM4,
-    resume_WHILEM5,
-    resume_WHILEM6,
-    resume_CURLYM1,
-    resume_CURLYM2,
-    resume_CURLYM3,
-    resume_IFMATCH,
-    resume_PLUS1,
-    resume_PLUS2,
-    resume_PLUS3,
-    resume_PLUS4
-} regmatch_resume_states;
-
-
 typedef struct regmatch_state {
 
     /* these vars contain state that needs to be maintained
      * across the main while loop ... */
 
-    regmatch_resume_states resume_state; /* where to jump to on return */
+    int resume_state;          /* where to jump to on return */
     regnode *scan;             /* Current node. */
     regnode *next;             /* Next node. */
     bool minmod;               /* the next "{n,m}" is a "{n,m}?" */
@@ -233,7 +211,9 @@ typedef struct regmatch_state {
 
        struct {
            reg_trie_accepted *accept_buff;
-           U32 accepted;       /* how many accepting states we have seen */
+           U32         accepted; /* how many accepting states we have seen */
+           regnode     *B;     /* node following the trie */
+           regnode     *me;    /* only needed for debugging */
        } trie;
 
        struct {
@@ -243,6 +223,7 @@ typedef struct regmatch_state {
            int         toggleutf;
            CHECKPOINT  cp;     /* remember current savestack indexes */
            CHECKPOINT  lastcp;
+           regnode     *B;     /* the node following us  */
        } eval;
 
        struct {
@@ -269,30 +250,39 @@ typedef struct regmatch_state {
        } whilem;
 
        struct {
+           I32 lastparen;
+           regnode *next_branch; /* next branch node */
+           CHECKPOINT cp;
+       } branch;
+
+       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;
+           CHECKPOINT cp;
+           I32 alen;           /* length of first-matched A string */
+           I32 count;
            bool minmod;
+           regnode *A, *B;     /* the nodes corresponding to /A*B/  */
+           regnode *me;        /* the curlym node */
        } curlym;
 
        struct {
            I32 paren;
-           CHECKPOINT lastcp;
+           CHECKPOINT cp;
            I32 c1, c2;         /* case fold search */
-           char *e;
-           char *old;
+           char *maxpos;       /* highest possible point in string to match */
+           char *oldloc;       /* the previous locinput */
            int count;
-       } plus; /* and CURLYN/CURLY/STAR */
+           int min, max;       /* {m,n} */
+           regnode *A, *B;     /* the nodes corresponding to /A*B/  */
+       } curly; /* and CURLYN/PLUS/STAR */
 
        struct {
            /* this first element must match u.yes */
            struct regmatch_state *prev_yes_state;
            I32 wanted;
+           regnode  *me; /* the IFMATCH/SUSPEND/UNLESSM node  */
        } ifmatch; /* and SUSPEND/UNLESSM */
     } u;
 } regmatch_state;