This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
in-place sort preserved element lvalue identity
[perl5.git] / regcomp.h
index 630e2e9..ec0c9f8 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
@@ -90,8 +90,6 @@
 /* This is the stuff that used to live in regexp.h that was truly
    private to the engine itself. It now lives here. */
 
-
-
  typedef struct regexp_internal {
         int name_list_idx;     /* Optional data index of an array of paren names */
         union {
 #define PREGf_ANCH_MBOL         0x00000400
 #define PREGf_ANCH_SBOL         0x00000800
 #define PREGf_ANCH_GPOS         0x00001000
+#define PREGf_RECURSE_SEEN      0x00002000
 
 #define PREGf_ANCH              \
     ( PREGf_ANCH_SBOL | PREGf_ANCH_GPOS | PREGf_ANCH_MBOL )
@@ -369,7 +368,7 @@ struct regnode_ssc {
 
 #define REG_MAGIC 0234
 
-#define SIZE_ONLY (RExC_emit == (regnode *) & RExC_emit_dummy)
+#define SIZE_ONLY cBOOL(RExC_emit == (regnode *) & RExC_emit_dummy)
 #define PASS1 SIZE_ONLY
 #define PASS2 (! SIZE_ONLY)
 
@@ -523,7 +522,7 @@ struct regnode_ssc {
                |ANYOFL_SHARED_UTF8_LOCALE_fold_HAS_MATCHES_nonfold_REQD))   \
              == ANYOFL_SHARED_UTF8_LOCALE_fold_HAS_MATCHES_nonfold_REQD)
 
-/* Spare:                                       0x10 */
+/* Spare: Be sure to change ANYOF_FLAGS_ALL if this gets used  0x10 */
 
 /* If set, the node matches every code point NUM_ANYOF_CODE_POINTS and above.
  * Can be in an SSC */
@@ -553,7 +552,7 @@ struct regnode_ssc {
  * are cautioned about its shared nature */
 #define ANYOF_SHARED_d_MATCHES_ALL_NON_UTF8_NON_ASCII_non_d_WARN_SUPER 0x80
 
-#define ANYOF_FLAGS_ALL                (0xff)
+#define ANYOF_FLAGS_ALL                (0xff & ~0x10)
 
 #define ANYOF_LOCALE_FLAGS (ANYOFL_FOLD | ANYOF_MATCHES_POSIXL)
 
@@ -716,7 +715,7 @@ struct regnode_ssc {
 #define REG_CUTGROUP_SEEN                   0x00000100
 #define REG_RUN_ON_COMMENT_SEEN             0x00000200
 #define REG_UNFOLDED_MULTI_SEEN             0x00000400
-#define REG_GOSTART_SEEN                    0x00000800
+/* spare */
 #define REG_UNBOUNDED_QUANTIFIER_SEEN       0x00001000
 
 
@@ -1055,7 +1054,7 @@ re.pm, especially to the documentation.
 /* get_sv() can return NULL during global destruction. */
 #define GET_RE_DEBUG_FLAGS DEBUG_r({ \
         SV * re_debug_flags_sv = NULL; \
-        re_debug_flags_sv = get_sv(RE_DEBUG_FLAGS, 1); \
+        re_debug_flags_sv = PL_curcop ? get_sv(RE_DEBUG_FLAGS, GV_ADD) : NULL; \
         if (re_debug_flags_sv) { \
             if (!SvIOK(re_debug_flags_sv)) \
                 sv_setuv(re_debug_flags_sv, RE_DEBUG_COMPILE_DUMP | RE_DEBUG_EXECUTE_MASK ); \
@@ -1069,22 +1068,25 @@ re.pm, especially to the documentation.
         PERL_UNUSED_VAR(re_debug_flags); GET_RE_DEBUG_FLAGS;
 
 #define RE_PV_COLOR_DECL(rpv,rlen,isuni,dsv,pv,l,m,c1,c2) \
-    const char * const rpv =                          \
-        pv_pretty((dsv), (pv), (l), (m), \
-            PL_colors[(c1)],PL_colors[(c2)], \
+    const char * const rpv =                                 \
+        pv_pretty((dsv), (pv), (l),                          \
+            (PL_dump_re_max_len) ? PL_dump_re_max_len : (m), \
+            PL_colors[(c1)],PL_colors[(c2)],                 \
             PERL_PV_ESCAPE_RE|PERL_PV_ESCAPE_NONASCII |((isuni) ? PERL_PV_ESCAPE_UNI : 0) );         \
     const int rlen = SvCUR(dsv)
 
-#define RE_SV_ESCAPE(rpv,isuni,dsv,sv,m) \
-    const char * const rpv =                          \
-        pv_pretty((dsv), (SvPV_nolen_const(sv)), (SvCUR(sv)), (m), \
-            PL_colors[(c1)],PL_colors[(c2)], \
+#define RE_SV_ESCAPE(rpv,isuni,dsv,sv,m)                        \
+    const char * const rpv =                                    \
+        pv_pretty((dsv), (SvPV_nolen_const(sv)), (SvCUR(sv)),   \
+            (PL_dump_re_max_len) ? PL_dump_re_max_len : (m),    \
+            PL_colors[(c1)],PL_colors[(c2)],                    \
             PERL_PV_ESCAPE_RE|PERL_PV_ESCAPE_NONASCII |((isuni) ? PERL_PV_ESCAPE_UNI : 0) )
 
 #define RE_PV_QUOTED_DECL(rpv,isuni,dsv,pv,l,m)                    \
     const char * const rpv =                                       \
-        pv_pretty((dsv), (pv), (l), (m), \
-            PL_colors[0], PL_colors[1], \
+        pv_pretty((dsv), (pv), (l),                                \
+            (PL_dump_re_max_len) ? PL_dump_re_max_len : (m),       \
+            PL_colors[0], PL_colors[1],                            \
             ( PERL_PV_PRETTY_QUOTE | PERL_PV_ESCAPE_RE | PERL_PV_ESCAPE_NONASCII | PERL_PV_PRETTY_ELLIPSES | \
               ((isuni) ? PERL_PV_ESCAPE_UNI : 0))                  \
         )
@@ -1106,6 +1108,7 @@ re.pm, especially to the documentation.
 typedef enum {
        TRADITIONAL_BOUND = _CC_WORDCHAR,
        GCB_BOUND,
+       LB_BOUND,
        SB_BOUND,
        WB_BOUND
 } bound_type;