diff options
author | Zefram <zefram@fysh.org> | 2010-10-13 19:05:19 +0100 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-21 05:52:30 -0700 |
commit | f07ec6dd59215a56bc1159449a9631be7a02a94d (patch) | |
tree | 11506817a1f4546234403635605c632e58a24f2b | |
parent | a3a44df66ac2cb0beb603b3dd9697fd81cfcfb30 (diff) | |
download | perl-f07ec6dd59215a56bc1159449a9631be7a02a94d.tar.gz |
remove filter inheritance option from lex_start
The only uses of lex_start that had the new_filter parameter false,
to make the new lexer context share source filters with the previous
lexer context, were uses with rsfp null, which therefore never invoked
source filters. Inheriting source filters from a logically unrelated
file seems like a silly idea anyway.
-rw-r--r-- | embed.fnc | 2 | ||||
-rw-r--r-- | embed.h | 2 | ||||
-rw-r--r-- | op.c | 2 | ||||
-rw-r--r-- | perl.c | 2 | ||||
-rw-r--r-- | pp_ctl.c | 6 | ||||
-rw-r--r-- | proto.h | 2 | ||||
-rw-r--r-- | toke.c | 8 |
7 files changed, 10 insertions, 14 deletions
@@ -614,7 +614,7 @@ Ap |void |leave_scope |I32 base : Used in pp_ctl.c, and by Data::Alias EXp |void |lex_end : Used in various files -p |void |lex_start |NULLOK SV* line|NULLOK PerlIO *rsfp|bool new_filter +p |void |lex_start |NULLOK SV* line|NULLOK PerlIO *rsfp : Public lexer API AMpd |bool |lex_bufutf8 AMpd |char* |lex_grow_linestr|STRLEN len @@ -996,7 +996,7 @@ #define is_gv_magical_sv(a,b) Perl_is_gv_magical_sv(aTHX_ a,b) #define jmaybe(a) Perl_jmaybe(aTHX_ a) #define keyword(a,b,c) Perl_keyword(aTHX_ a,b,c) -#define lex_start(a,b,c) Perl_lex_start(aTHX_ a,b,c) +#define lex_start(a,b) Perl_lex_start(aTHX_ a,b) #define list(a) Perl_list(aTHX_ a) #define localize(a,b) Perl_localize(aTHX_ a,b) #define magic_clear_all_env(a,b) Perl_magic_clear_all_env(aTHX_ a,b) @@ -4364,7 +4364,7 @@ Perl_vload_module(pTHX_ U32 flags, SV *name, SV *ver, va_list *args) ENTER; SAVEVPTR(PL_curcop); - lex_start(NULL, NULL, FALSE); + lex_start(NULL, NULL); utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), veop, modname, imop); LEAVE; @@ -2152,7 +2152,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) } #endif - lex_start(linestr_sv, rsfp, TRUE); + lex_start(linestr_sv, rsfp); PL_subname = newSVpvs("main"); if (add_read_e_script) @@ -2993,7 +2993,7 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, const char *code, PAD** padp) PERL_ARGS_ASSERT_SV_COMPILE_2OP; ENTER_with_name("eval"); - lex_start(sv, NULL, FALSE); + lex_start(sv, NULL); SAVETMPS; /* switch to eval mode */ @@ -3767,7 +3767,7 @@ PP(pp_require) ENTER_with_name("eval"); SAVETMPS; - lex_start(NULL, tryrsfp, TRUE); + lex_start(NULL, tryrsfp); SAVEHINTS(); PL_hints = 0; @@ -3862,7 +3862,7 @@ PP(pp_entereval) TAINT_PROPER("eval"); ENTER_with_name("eval"); - lex_start(sv, NULL, FALSE); + lex_start(sv, NULL); SAVETMPS; /* switch to eval mode */ @@ -1795,7 +1795,7 @@ PERL_CALLCONV void Perl_lex_read_to(pTHX_ char* ptr) assert(ptr) PERL_CALLCONV I32 Perl_lex_read_unichar(pTHX_ U32 flags); -PERL_CALLCONV void Perl_lex_start(pTHX_ SV* line, PerlIO *rsfp, bool new_filter); +PERL_CALLCONV void Perl_lex_start(pTHX_ SV* line, PerlIO *rsfp); PERL_CALLCONV void Perl_lex_stuff_pv(pTHX_ const char* pv, U32 flags) __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_LEX_STUFF_PV \ @@ -654,13 +654,10 @@ S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen) * * line holds any initial content already read from the file (or in * the case of no file, such as an eval, the whole contents); - * - * new_filter indicates that this is a new file and it shouldn't inherit - * the filters from the current parser (ie require). */ void -Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, bool new_filter) +Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp) { dVAR; const char *s = NULL; @@ -693,8 +690,7 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, bool new_filter) parser->lex_state = LEX_NORMAL; parser->expect = XSTATE; parser->rsfp = rsfp; - parser->rsfp_filters = (new_filter || !oparser) ? newAV() - : MUTABLE_AV(SvREFCNT_inc(oparser->rsfp_filters)); + parser->rsfp_filters = newAV(); Newx(parser->lex_brackstack, 120, char); Newx(parser->lex_casestack, 12, char); |