Upgrade to Text-Tabs+Wrap-2006.0711. Keep the local changes from
[p5sagit/p5-mst-13.2.git] / regcomp.c
index 4c389f3..10c6682 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -1878,9 +1878,11 @@ S_join_exact(pTHX_ RExC_state_t *pRExC_state, regnode *scan, I32 *min, U32 flags
     regnode *stop = scan;
     GET_RE_DEBUG_FLAGS_DECL;
 #else
+    PERL_UNUSED_ARG(depth);
+#endif
+#ifndef EXPERIMENTAL_INPLACESCAN
     PERL_UNUSED_ARG(flags);
     PERL_UNUSED_ARG(val);
-    PERL_UNUSED_ARG(depth);
 #endif
     DEBUG_PEEP("join",scan,depth);
     
@@ -1894,7 +1896,6 @@ S_join_exact(pTHX_ RExC_state_t *pRExC_state, regnode *scan, I32 *min, U32 flags
         if (OP(n) == TAIL || n > next)
             stringok = 0;
         if (PL_regkind[OP(n)] == NOTHING) {
-        
             DEBUG_PEEP("skip:",n,depth);
             NEXT_OFF(scan) += NEXT_OFF(n);
             next = n + NODE_STEP_REGNODE;
@@ -1925,17 +1926,17 @@ S_join_exact(pTHX_ RExC_state_t *pRExC_state, regnode *scan, I32 *min, U32 flags
             if (stopnow) break;
         }
 
-#ifdef  EXPERIMENTAL_INPLACESCAN
-        if (flags && !NEXT_OFF(n)) {
-            DEBUG_PEEP("atch",val,depth);            
-            if (reg_off_by_arg[OP(n)]) {
-               ARG_SET(n, val - n);
-            }
-            else {
-               NEXT_OFF(n) = val - n;
-            }
-            stopnow=1;
-        }            
+#ifdef EXPERIMENTAL_INPLACESCAN
+       if (flags && !NEXT_OFF(n)) {
+           DEBUG_PEEP("atch", val, depth);
+           if (reg_off_by_arg[OP(n)]) {
+               ARG_SET(n, val - n);
+           }
+           else {
+               NEXT_OFF(n) = val - n;
+           }
+           stopnow = 1;
+       }
 #endif
     }
     
@@ -3388,7 +3389,7 @@ reStudy:
                if (OP(first) == IFMATCH) {
                    first = NEXTOPER(first);
                    first += EXTRA_STEP_2ARGS;
-               } else  /*xxx possible optimisation for /(?=)/*/
+               } else  /* XXX possible optimisation for /(?=)/  */
                    first = NEXTOPER(first);
        }
 
@@ -6422,13 +6423,8 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
         * be the best for now since we have no flag "this EXACTish
         * node was UTF-8" --jhi */
        const bool do_utf8 = is_utf8_string((U8*)STRING(o), STR_LEN(o));
-       const char * const s = do_utf8 ?
-         pv_uni_display(dsv, (U8*)STRING(o), STR_LEN(o), 60,
-                        UNI_DISPLAY_REGEX) :
-         STRING(o);
-       const int len = do_utf8 ?
-         strlen(s) :
-         STR_LEN(o);
+       RE_PV_DISPLAY_DECL(s, len, do_utf8, dsv, STRING(o), STR_LEN(o), 60);
+
        Perl_sv_catpvf(aTHX_ sv, " <%s%.*s%s>",
                       PL_colors[0],
                       len, s,
@@ -6627,26 +6623,25 @@ void
 Perl_pregfree(pTHX_ struct regexp *r)
 {
     dVAR;
-#ifdef DEBUGGING
-    SV * const dsv = PERL_DEBUG_PAD_ZERO(0);
-#endif
+
+
+
     GET_RE_DEBUG_FLAGS_DECL;
 
     if (!r || (--r->refcnt > 0))
        return;
     DEBUG_COMPILE_r(if (RX_DEBUG(r)){
-        const char * const s = (r->reganch & ROPT_UTF8)
-            ? pv_uni_display(dsv, (U8*)r->precomp, r->prelen, 60, UNI_DISPLAY_REGEX)
-            : pv_display(dsv, r->precomp, r->prelen, 0, 60);
-        const int len = SvCUR(dsv);
-        if (!PL_colorset)
-             reginitcolors();
-        PerlIO_printf(Perl_debug_log,
-                      "%sFreeing REx:%s %s%*.*s%s%s\n",
-                      PL_colors[4],PL_colors[5],PL_colors[0],
-                      len, len, s,
-                      PL_colors[1],
-                      len > 60 ? "..." : "");
+       RE_PV_DISPLAY_DECL(s, len, (r->reganch & ROPT_UTF8),
+           PERL_DEBUG_PAD_ZERO(0), r->precomp, r->prelen, 60);
+
+       if (!PL_colorset)
+           reginitcolors();
+       PerlIO_printf(Perl_debug_log,
+           "%sFreeing REx:%s %s%*.*s%s%s\n",
+           PL_colors[4],PL_colors[5],PL_colors[0],
+           len, len, s,
+           PL_colors[1],
+           len > 60 ? "..." : "");
     });
 
     /* gcov results gave these as non-null 100% of the time, so there's no