Fix line nums when multiline ${expr} spans here-doc
authorFather Chrysostomos <sprout@cpan.org>
Fri, 20 Sep 2013 07:50:54 +0000 (00:50 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 20 Sep 2013 08:19:07 +0000 (01:19 -0700)
commit8c29fccb2d2fd2d0d9fd6074018645febe1cb943
tree5e94aa910c68f5582c06d3f87e7768d19678ba7d
parent4aaee9b8df62149cfed9099d3b9422c6d397c274
Fix line nums when multiline ${expr} spans here-doc

<<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.
t/comp/parser.t
toke.c