OP *sub_op; /* "lex_op" to use */
char *super_bufptr; /* PL_parser->bufptr that was */
char *re_eval_start;/* start of "(?{..." text */
+ SV *repl; /* replacement of s/// or y/// */
};
#include "parser.h"
SAVEI32(PL_lex_casemods);
SAVEI32(PL_lex_starts);
SAVEI8(PL_lex_state);
+ SAVESPTR(PL_lex_repl);
SAVEPPTR(PL_sublex_info.re_eval_start);
SAVEPPTR(PL_sublex_info.super_bufptr);
SAVEVPTR(PL_lex_inpat);
SvNVX(PL_lex_stuff) = PTR2NV(PL_linestr);
PL_linestr = PL_lex_stuff;
+ PL_lex_repl = PL_sublex_info.repl;
PL_lex_stuff = NULL;
+ PL_sublex_info.repl = NULL;
PL_sublex_info.re_eval_start = NULL;
PL_bufend = PL_bufptr = PL_oldbufptr = PL_oldoldbufptr = PL_linestart
sv_catpvs(repl, "do ");
}
sv_catpvs(repl, "{");
- sv_catsv(repl, PL_lex_repl);
- if (strchr(SvPVX(PL_lex_repl), '#'))
+ sv_catsv(repl, PL_sublex_info.repl);
+ if (strchr(SvPVX(PL_sublex_info.repl), '#'))
sv_catpvs(repl, "\n");
sv_catpvs(repl, "}");
SvEVALED_on(repl);
- SvREFCNT_dec(PL_lex_repl);
- PL_lex_repl = repl;
+ SvREFCNT_dec(PL_sublex_info.repl);
+ PL_sublex_info.repl = repl;
}
PL_lex_op = (OP*)pm;
o->op_private &= ~OPpTRANS_ALL;
o->op_private |= del|squash|complement|
(DO_UTF8(PL_lex_stuff)? OPpTRANS_FROM_UTF : 0)|
- (DO_UTF8(PL_lex_repl) ? OPpTRANS_TO_UTF : 0);
+ (DO_UTF8(PL_sublex_info.repl) ? OPpTRANS_TO_UTF : 0);
PL_lex_op = o;
pl_yylval.ival = nondestruct ? OP_TRANSR : OP_TRANS;
*/
if (PL_lex_stuff)
- PL_lex_repl = sv;
+ PL_sublex_info.repl = sv;
else
PL_lex_stuff = sv;
return s;