From 8c29fccb2d2fd2d0d9fd6074018645febe1cb943 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 20 Sep 2013 00:50:54 -0700 Subject: [PATCH] Fix line nums when multiline ${expr} spans here-doc MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit <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 | 10 +++++++++- toke.c | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/t/comp/parser.t b/t/comp/parser.t index 6578c74..8fd7e85 100644 --- a/t/comp/parser.t +++ b/t/comp/parser.t @@ -8,7 +8,7 @@ BEGIN { chdir 't'; } -print "1..167\n"; +print "1..168\n"; sub failed { my ($got, $expected, $name) = @_; @@ -634,5 +634,13 @@ ${; END check_line(627, 'line number after heredoc containing #line'); +#line 638 +<herelines; SSize_t bracket = -1; char funny = *s++; char *d = dest; @@ -9552,6 +9553,7 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni) 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'; } } -- 2.7.4