This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add lex_re_reparsing boolean to yy_parser struct
authorDavid Mitchell <davem@iabyn.com>
Tue, 9 Apr 2013 16:17:16 +0000 (17:17 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 12 Apr 2013 10:29:55 +0000 (11:29 +0100)
commit3a54fd60e3d777bf86f4eec331b79a61c23d8393
tree09ca42e0a07d6bff9f76154f28fc911503959ffb
parentc1789b9f89e17b99d728910cb490561f334c2033
add lex_re_reparsing boolean to yy_parser struct

When re-parsing a pattern for run-time (?{}) code blocks,
we end up with the EVAL_RE_REPARSING flag set in PL_in_eval.
Currently we clear this flag as soon as scan_str() returns, to ensure that
it's not set if we happen to parse further patterns (e.g. within the
(?{ ... }) code itself.

However, a soon-to-be-applied bugfix requires us to know the reparsing
state beyond this point. To solve this, we add a new boolean flag to the
parser struct, which is set from PL_in_eval in S_sublex_push() (with the
old value being saved). This allows us to have the flag around for the
entire pattern string parsing phase, without it affecting nested pattern
compilation.
parser.h
regcomp.c
regexec.c
toke.c