Eliminate PL_reg_state.re_reparsing, part 2
authorDavid Mitchell <davem@iabyn.com>
Thu, 4 Apr 2013 16:50:22 +0000 (17:50 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 12 Apr 2013 10:29:55 +0000 (11:29 +0100)
The previous commit added an alternative flag mechanism to
PL_reg_state.re_reparsing, but kept the old one around for consistency
checking. Remove the old one now.

perl.c
regcomp.c
regexec.c
regexp.h
toke.c

index 9f41768..a39d66f 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -2808,7 +2808,6 @@ Perl_eval_sv(pTHX_ SV *sv, I32 flags)
     myop.op_flags |= OP_GIMME_REVERSE(flags);
     if (flags & G_KEEPERR)
        myop.op_flags |= OPf_SPECIAL;
-    assert (! (!!(PL_reg_state.re_reparsing ^ !!(flags & G_RE_REPARSING))));
 
     if (flags & G_RE_REPARSING)
        myop.op_private = (OPpEVAL_COPHH | OPpEVAL_RE_REPARSING);
index 9873aaf..0849a97 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5006,7 +5006,6 @@ S_compile_runtime_code(pTHX_ RExC_state_t * const pRExC_state,
         /* G_RE_REPARSING causes the toker to collapse \\ into \ when
          * parsing qr''; normally only q'' does this. It also alters
          * hints handling */
-       PL_reg_state.re_reparsing = TRUE;
        eval_sv(sv, G_SCALAR|G_RE_REPARSING);
        SvREFCNT_dec_NN(sv);
        SPAGAIN;
@@ -5634,7 +5633,6 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
      * from the compile flags.
      */
 
-    assert (!(!!(PL_reg_state.re_reparsing ^ !!(PL_in_eval & EVAL_RE_REPARSING))));
     if (   old_re
         && !recompile
         && !!RX_UTF8(old_re) == !!RExC_utf8
index 017cbff..bb6c958 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -4878,7 +4878,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
                 */
                Copy(&PL_reg_state, &saved_state, 1, struct re_save_state);
 
-               PL_reg_state.re_reparsing = FALSE;
                 PL_in_eval &= ~EVAL_RE_REPARSING;
 
                if (!caller_cv)
index 6b16d14..31fb879 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -776,7 +776,6 @@ typedef struct regmatch_slab {
 struct re_save_state {
     bool re_state_eval_setup_done;     /* from regexec.c */
     bool re_state_reg_match_utf8;      /* from regexec.c */
-    bool re_reparsing;                 /* runtime (?{}) fed back into parser */
     /* Space for U8 */
     I32 re_state_reg_oldpos;           /* from regexec.c */
     I32 re_state_reg_maxiter;          /* max wait until caching pos */
diff --git a/toke.c b/toke.c
index 929bdee..4581bfd 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -9514,14 +9514,12 @@ S_scan_pat(pTHX_ char *start, I32 type)
 
     PERL_ARGS_ASSERT_SCAN_PAT;
 
-    assert (!(!!(PL_reg_state.re_reparsing ^ !!(PL_in_eval & EVAL_RE_REPARSING))));
     s = scan_str(start,!!PL_madskills,FALSE, (PL_in_eval & EVAL_RE_REPARSING),
                        TRUE /* look for escaped bracketed metas */ );
 
     /* this was only needed for the initial scan_str; set it to false
      * so that any (?{}) code blocks etc are parsed normally */
     PL_in_eval &= ~EVAL_RE_REPARSING;
-    PL_reg_state.re_reparsing = FALSE;
     if (!s) {
        const char * const delimiter = skipspace(start);
        Perl_croak(aTHX_