\G with /g results in infinite loop in 5.6 and later
[p5sagit/p5-mst-13.2.git] / regcomp.h
index 183420f..e8fd39f 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
 typedef OP OP_4tree;                   /* Will be redefined later. */
 
 
+/* Convert branch sequences to more efficient trie ops? */
 #define PERL_ENABLE_TRIE_OPTIMISATION 1
+
+/* Be really agressive about optimising patterns with trie sequences? */
 #define PERL_ENABLE_EXTENDED_TRIE_OPTIMISATION 1
+
+/* Should the optimiser take positive assertions into account? */
 #define PERL_ENABLE_POSITIVE_ASSERTION_STUDY 1
+
+/* Not for production use: */
 #define PERL_ENABLE_EXPERIMENTAL_REGEX_OPTIMISATIONS 0
 
+/* Unless the next line is uncommented it is illegal to combine lazy 
+   matching with possessive matching. Frankly it doesn't make much sense 
+   to allow it as X*?+ matches nothing, X+?+ matches a single char only, 
+   and X{min,max}?+ matches min times only.
+ */
+/* #define REG_ALLOW_MINMOD_SUSPEND */
+
 /*
  * The "internal use only" fields in regexp.h are present to pass info from
  * compile to execute that permits the execute phase to run lots faster on
@@ -344,6 +358,9 @@ struct regnode_charclass_class {    /* has [[:blah:]] classes */
 #define REG_SEEN_CANY          0x00000010
 #define REG_SEEN_SANY          REG_SEEN_CANY /* src bckwrd cmpt */
 #define REG_SEEN_RECURSE        0x00000020
+#define REG_TOP_LEVEL_BRANCHES  0x00000040
+#define REG_SEEN_VERBARG        0x00000080
+#define REG_SEEN_CUTGROUP       0x00000100
 
 START_EXTERN_C
 
@@ -390,6 +407,7 @@ EXTCONST regexp_engine PL_core_reg_engine = {
         Perl_re_intuit_start,
         Perl_re_intuit_string, 
         Perl_pregfree, 
+        Perl_reg_stringify,
 #if defined(USE_ITHREADS)        
         Perl_regdupe 
 #endif        
@@ -412,6 +430,7 @@ END_EXTERN_C
  *       in the character class
  *   t - trie struct
  *   T - aho-trie struct
+ *   S - sv for named capture lookup
  * 20010712 mjd@plover.com
  * (Remember to update re_dup() and pregfree() if you add any items.)
  */
@@ -511,7 +530,8 @@ struct _reg_trie_data {
                                         for the node following a given word. */
     U16                    *nextword;       /* optional 1 indexed array to support linked list
                                         of duplicate wordnums */
-    U32             laststate;       /* Build only */
+    U32             statecount;      /* Build only - number of states in the states array 
+                                        (including the unused zero state) */
     U32             wordcount;       /* Build only */
 #ifdef DEBUGGING
     STRLEN          charcount;       /* Build only */
@@ -615,6 +635,8 @@ re.pm, especially to the documentation.
 #define RE_DEBUG_EXTRA_OFFDEBUG    0x040000
 #define RE_DEBUG_EXTRA_STATE       0x080000
 #define RE_DEBUG_EXTRA_OPTIMISE    0x100000
+/* combined */
+#define RE_DEBUG_EXTRA_STACK       0x280000
 
 #define RE_DEBUG_FLAG(x) (re_debug_flags & x)
 /* Compile */
@@ -648,6 +670,8 @@ re.pm, especially to the documentation.
     if (re_debug_flags & RE_DEBUG_EXTRA_OFFSETS) x  )
 #define DEBUG_STATE_r(x) DEBUG_r( \
     if (re_debug_flags & RE_DEBUG_EXTRA_STATE) x )
+#define DEBUG_STACK_r(x) DEBUG_r( \
+    if (re_debug_flags & RE_DEBUG_EXTRA_STACK) x )
 #define DEBUG_OPTIMISE_MORE_r(x) DEBUG_r( \
     if ((RE_DEBUG_EXTRA_OPTIMISE|RE_DEBUG_COMPILE_OPTIMISE) == \
          (re_debug_flags & (RE_DEBUG_EXTRA_OPTIMISE|RE_DEBUG_COMPILE_OPTIMISE)) ) x )