summaryrefslogtreecommitdiff
path: root/parser.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-06 08:38:28 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-08-06 14:04:03 -0700
commit583c9d5cccfe6eadf42350e2baa975576a360f02 (patch)
tree91dc5b7f31dfa5657961e48c06e34383d2a53d03 /parser.h
parentfbfa7c02afa6e3e6975eb25b333402cf754833e3 (diff)
downloadperl-583c9d5cccfe6eadf42350e2baa975576a360f02.tar.gz
[perl #114040] Parse formats in interpolating constructs
For re-evals, this is something that broke recently, post-5.16 (the jumbo fix). For other interpolating constructs, this has never worked, as far as I can tell. The lexer was losing track of PL_lex_state (aka PL_parser->lex_state) when parsing formats. Usually, the state alternates between LEX_FORMLINE (a picture line) and LEX_NORMAL (an argument line), but the LEX_NORMAL should actually be whatever the state was before the format started. This commit adds a new parser member to track the ‘normal’ state when parsing a format. It also tweaks S_scan_formline to handle multi-line buffers outside of string eval (such as happens in interpolating constructs). That bufend assignment that is removed as a result is not necessary as of a0d0e21ea6ea (perl 5.000). That very commit added a bufend assign- ment after the sv_gets (later filter_gets; later lex_next_chunk) fur- ther down in the loop in scan_formline.
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/parser.h b/parser.h
index 1d5a7a876b..bfb2480127 100644
--- a/parser.h
+++ b/parser.h
@@ -80,6 +80,7 @@ typedef struct yy_parser {
HV *in_my_stash; /* declared class of this "my" declaration */
PerlIO *rsfp; /* current source file pointer */
AV *rsfp_filters; /* holds chain of active source filters */
+ U8 form_lex_state; /* remember lex_state when parsing fmt */
#ifdef PERL_MAD
SV *endwhite;