summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2010-10-13 19:05:19 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-10-21 05:52:30 -0700
commitf07ec6dd59215a56bc1159449a9631be7a02a94d (patch)
tree11506817a1f4546234403635605c632e58a24f2b
parenta3a44df66ac2cb0beb603b3dd9697fd81cfcfb30 (diff)
downloadperl-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.fnc2
-rw-r--r--embed.h2
-rw-r--r--op.c2
-rw-r--r--perl.c2
-rw-r--r--pp_ctl.c6
-rw-r--r--proto.h2
-rw-r--r--toke.c8
7 files changed, 10 insertions, 14 deletions
diff --git a/embed.fnc b/embed.fnc
index d5a99c5fed..a89730c589 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -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
diff --git a/embed.h b/embed.h
index b0d35f1773..53f6154480 100644
--- a/embed.h
+++ b/embed.h
@@ -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)
diff --git a/op.c b/op.c
index 3121cb49d1..d8140447f5 100644
--- a/op.c
+++ b/op.c
@@ -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;
diff --git a/perl.c b/perl.c
index b524084ef4..bdb9b563f5 100644
--- a/perl.c
+++ b/perl.c
@@ -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)
diff --git a/pp_ctl.c b/pp_ctl.c
index 16e7cf93a7..296ded746d 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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 */
diff --git a/proto.h b/proto.h
index fb3ed70f8f..eb9d037ad1 100644
--- a/proto.h
+++ b/proto.h
@@ -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 \
diff --git a/toke.c b/toke.c
index 36d1f242db..cba2bd9814 100644
--- a/toke.c
+++ b/toke.c
@@ -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);