This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert lib/Text/ParseWords.t to Test::More
[perl5.git] / regexp.h
index 5e3e947..49d6cd1 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -31,10 +31,15 @@ struct reg_substr_data;
 struct reg_data;
 
 struct regexp_engine;
+typedef struct regexp_paren_ofs {
+    I32 *startp;
+    I32 *endp;
+} regexp_paren_ofs;
 
 typedef struct regexp {
-       I32 *startp;
+        I32 *startp;
        I32 *endp;
+        regexp_paren_ofs *swap;
        regnode *regstclass;
         struct reg_substr_data *substrs;
        char *precomp;          /* pre-compilation regular expression */
@@ -100,15 +105,15 @@ typedef struct regexp_engine {
 #define ROPT_SANY_SEEN         ROPT_CANY_SEEN /* src bckwrd cmpt */
 #define ROPT_GPOS_CHECK         (ROPT_GPOS_SEEN|ROPT_ANCH_GPOS)
 
-/* 0xf800 of reganch is used by PMf_COMPILETIME */
+/* 0xF800 of reganch is used by PMf_COMPILETIME */
 
 #define ROPT_UTF8              0x00010000
 #define ROPT_NAUGHTY           0x00020000 /* how exponential is this pattern? */
 #define ROPT_COPY_DONE         0x00040000      /* subbeg is a copy of the string */
 #define ROPT_TAINTED_SEEN      0x00080000
 #define ROPT_MATCH_UTF8                0x10000000 /* subbeg is utf-8 */
-#define ROPT_RECURSE_SEEN       0x20000000
-#define ROPT_VERBARG_SEEN       0x40000000
+#define ROPT_VERBARG_SEEN       0x20000000
+#define ROPT_CUTGROUP_SEEN      0x40000000
 
 #define RE_USE_INTUIT_NOML     0x00100000 /* Best to intuit before matching */
 #define RE_USE_INTUIT_ML       0x00200000
@@ -124,6 +129,7 @@ typedef struct regexp_engine {
 #define REINT_AUTORITATIVE     (REINT_AUTORITATIVE_NOML|REINT_AUTORITATIVE_ML)
 #define REINT_ONCE             (REINT_ONCE_NOML|REINT_ONCE_ML)
 
+#define RX_HAS_CUTGROUP(prog) ((prog)->reganch & ROPT_CUTGROUP_SEEN)
 #define RX_MATCH_TAINTED(prog) ((prog)->reganch & ROPT_TAINTED_SEEN)
 #define RX_MATCH_TAINTED_on(prog) ((prog)->reganch |= ROPT_TAINTED_SEEN)
 #define RX_MATCH_TAINTED_off(prog) ((prog)->reganch &= ~ROPT_TAINTED_SEEN)
@@ -142,10 +148,6 @@ typedef struct regexp_engine {
 
 /* Stuff that needs to be included in the plugable extension goes below here */
 
-#define RE_DEBUG_BIT            0x20000000
-#define RX_DEBUG(prog) ((prog)->reganch & RE_DEBUG_BIT)
-#define RX_DEBUG_on(prog) ((prog)->reganch |= RE_DEBUG_BIT)
-
 #ifdef PERL_OLD_COPY_ON_WRITE
 #define RX_MATCH_COPY_FREE(rx) \
        STMT_START {if (rx->saved_copy) { \
@@ -187,8 +189,6 @@ typedef struct regexp_engine {
 
 #define FBMrf_MULTILINE        1
 
-struct re_scream_pos_data_s;
-
 /* an accepting state/position*/
 struct _reg_trie_accepted {
     U8   *endpos;
@@ -229,6 +229,8 @@ typedef struct regmatch_state {
        } yes;
 
        struct {
+           /* this first element must match u.yes */
+           struct regmatch_state *prev_yes_state;
            reg_trie_accepted *accept_buff;
            U32         accepted; /* how many accepting states we have seen */
            U16         *jump;  /* positive offsets from me */
@@ -279,6 +281,8 @@ typedef struct regmatch_state {
        } whilem;
 
        struct {
+           /* this first element must match u.yes */
+           struct regmatch_state *prev_yes_state;
            U32 lastparen;
            regnode *next_branch; /* next branch node */
            CHECKPOINT cp;