From a1941760704242726e754cde1820f738676ca838 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Thu, 4 Apr 2013 17:29:53 +0100 Subject: Eliminate PL_reg_state.re_reparsing, part 1 PL_reg_state.re_reparsing is a hacky flag used to allow runtime code blocks to be included in patterns. Basically, since code blocks are now handled by the perl parser within literal patterns, runtime patterns are handled by taking the (assembled at runtime) pattern, and feeding it back through the parser via the equivalent of eval q{qr'the_pattern'}, so that run-time (?{..})'s appear to be literal code blocks. When this happens, the global flag PL_reg_state.re_reparsing is set, which modifies lexing and parsing in minor ways (such as whether \\ is stripped). Now, I'm in the slow process of trying to eliminate global regex state (i.e. gradually removing the fields of PL_reg_state), and also a change which will be coming a few commits ahead requires the info which this flag indicates to linger for longer (currently it is cleared immediately after the call to scan_str(). For those two reasons, this commit adds a new mechanism to indicate this: a new flag to eval_sv(), G_RE_REPARSING (which sets OPpEVAL_RE_REPARSING in the entereval op), which sets the EVAL_RE_REPARSING bit in PL_in_eval. Its still a yukky global flag hack, but its a *different* global flag hack now. For this commit, we add the new flag(s) but keep the old PL_reg_state.re_reparsing flag and assert that the two mechanisms always match. The next commit will remove re_reparsing. --- op.h | 1 + 1 file changed, 1 insertion(+) (limited to 'op.h') diff --git a/op.h b/op.h index 8b87a9c14d..7c5030dde7 100644 --- a/op.h +++ b/op.h @@ -308,6 +308,7 @@ Deprecated. Use C instead. #define OPpEVAL_UNICODE 4 #define OPpEVAL_BYTES 8 #define OPpEVAL_COPHH 16 /* Construct %^H from cop hints */ +#define OPpEVAL_RE_REPARSING 32 /* eval_sv(..., G_RE_REPARSING) */ /* Private for OP_CALLER, OP_WANTARRAY and OP_RUNCV */ #define OPpOFFBYONE 128 /* Treat caller(1) as caller(2) */ -- cgit v1.2.1