diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-28 01:11:30 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-28 01:13:17 -0700 |
commit | 60f40a389519ab4482a60df44e5e9a03c8710752 (patch) | |
tree | 3655689f6491d244b0fa3b5aa0806206490e5fef /perl.h | |
parent | 473015163cb5f5f4cc6ef07c71f34b9d6c8608f1 (diff) | |
download | perl-60f40a389519ab4482a60df44e5e9a03c8710752.tar.gz |
Use PL_parser->lex_shared instead of Sv[IN]VX(PL_linestr)
Unfortunately, PL_parser->linestr and PL_parser->bufptr are both
part of the API, so we can’t just move them to PL_parser->lex_shared.
Instead, we have to copy them in sublex_push, to make them visible to
inner lexing scopes.
This allows the SvIVX(PL_linestr) and SvNVX(PL_linestr) hack to
be removed.
It should also speed things up slightly. We are already allocating
PL_parser->lex_shared in sublex_push, so there should be no need to
upgrade PL_linestr to SvNVX as well.
I was pleasantly surprised to see how the here-doc code seemed to
shrink all by itself when modified to account.
PL_sublex_info.super_bufptr is also superseded by the addition of
->ls_bufptr to the LEXSHARED struct. Its old values when localised
were not visible, being stashed away on the savestack, so it was
harder to use.
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -3456,7 +3456,6 @@ struct _sublex_info { U8 super_state; /* lexer state to save */ U16 sub_inwhat; /* "lex_inwhat" to use */ OP *sub_op; /* "lex_op" to use */ - char *super_bufptr; /* PL_parser->bufptr that was */ char *re_eval_start;/* start of "(?{..." text */ SV *re_eval_str; /* "(?{...})" text */ SV *repl; /* replacement of s/// or y/// */ |