<<end . ${
end
"bar"};
warn __LINE__ # 3, not 5
This was caused by commit
a49b10d0a, which make scan_ident in toke.c
reallocate the parser’s current line buffer (SvPVX(PL_linestr)) to
search for whitespace surrounding an identifier.
In case there is an arbitrary expression, it temporarily records the
line number and resets it at the end if that turns out to be the case.
However, it was not resetting PL_parser->herelines, which records how
many line numbers to skip when next incrementing it (to skip past
here-doc bodies).
So save and restore that value, too.
chdir 't';
}
-print "1..167\n";
+print "1..168\n";
sub failed {
my ($got, $expected, $name) = @_;
END
check_line(627, 'line number after heredoc containing #line');
+#line 638
+<<ENE . ${
+
+ENE
+"bar"};
+check_line(642, 'line number after ${expr} surrounding heredoc body');
+
+
__END__
# Don't add new tests HERE. See note above
S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni)
{
dVAR;
+ I32 herelines = PL_parser->herelines;
SSize_t bracket = -1;
char funny = *s++;
char *d = dest;
state such that the next thing to process is the opening { and */
s = SvPVX(PL_linestr) + bracket; /* let the parser handle it */
CopLINE_set(PL_curcop, orig_copline);
+ PL_parser->herelines = herelines;
*dest = '\0';
}
}