summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2010-10-13 19:59:23 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-10-21 05:52:39 -0700
commit737c24fc85ea612b3265f06a29053674bfbe17bd (patch)
tree3741fc528606f4639eb64ee7af38f062516fd865 /toke.c
parentf07ec6dd59215a56bc1159449a9631be7a02a94d (diff)
downloadperl-737c24fc85ea612b3265f06a29053674bfbe17bd.tar.gz
replace PL_doextract with better kinds of variable
PL_doextract had two unrelated jobs, neither best served by an interpreter global variable. The first was to track the -x command-line switch. That is replaced with a local variable in S_parse_body(). The second was to track whether the lexer is in the middle of a =pod section. That is replaced with an element in PL_parser.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/toke.c b/toke.c
index cba2bd9814..68e5aeea04 100644
--- a/toke.c
+++ b/toke.c
@@ -720,6 +720,8 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp)
parser->linestart = SvPVX(parser->linestr);
parser->bufend = parser->bufptr + SvCUR(parser->linestr);
parser->last_lop = parser->last_uni = NULL;
+
+ parser->in_pod = 0;
}
@@ -756,8 +758,6 @@ Perl_parser_free(pTHX_ const yy_parser *parser)
void
Perl_lex_end(pTHX)
{
- dVAR;
- PL_doextract = FALSE;
}
/*
@@ -1267,7 +1267,7 @@ Perl_lex_next_chunk(pTHX_ U32 flags)
else if (PL_parser->rsfp)
(void)PerlIO_close(PL_parser->rsfp);
PL_parser->rsfp = NULL;
- PL_doextract = FALSE;
+ PL_parser->in_pod = 0;
#ifdef PERL_MAD
if (PL_madskills && !PL_in_eval && (PL_minus_p || PL_minus_n))
PL_faketokens = 1;
@@ -4693,7 +4693,7 @@ Perl_yylex(pTHX)
s = swallow_bom((U8*)s);
}
}
- if (PL_doextract) {
+ if (PL_parser->in_pod) {
/* Incest with pod. */
#ifdef PERL_MAD
if (PL_madskills)
@@ -4704,12 +4704,12 @@ Perl_yylex(pTHX)
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
PL_last_lop = PL_last_uni = NULL;
- PL_doextract = FALSE;
+ PL_parser->in_pod = 0;
}
}
if (PL_rsfp)
incline(s);
- } while (PL_doextract);
+ } while (PL_parser->in_pod);
PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = s;
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
PL_last_lop = PL_last_uni = NULL;
@@ -5658,7 +5658,7 @@ Perl_yylex(pTHX)
}
#endif
s = PL_bufend;
- PL_doextract = TRUE;
+ PL_parser->in_pod = 1;
goto retry;
}
}