In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/945fff052a1ae1a94b53e9255561aa632a67259d?hp=9f94e05533f94bb11e398d9fd7c7a064b86c451a>
- Log ----------------------------------------------------------------- commit 945fff052a1ae1a94b53e9255561aa632a67259d Author: Matthew Horsfall <wolfs...@gmail.com> Date: Tue Nov 15 07:41:51 2016 -0500 Report indented here-doc line errors correctly ----------------------------------------------------------------------- Summary of changes: t/op/heredoc.t | 8 +++++++- toke.c | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/t/op/heredoc.t b/t/op/heredoc.t index b7e4c7d..e4aa8a5 100644 --- a/t/op/heredoc.t +++ b/t/op/heredoc.t @@ -7,7 +7,7 @@ BEGIN { } use strict; -plan(tests => 136); +plan(tests => 137); # heredoc without newline (#65838) { @@ -210,6 +210,12 @@ HEREDOC "indented here-doc with bad indentation" ]; + push @tests, [ + "print <<~EOF;\n $string\n $string\n$string\n $string\n EOF", + "Indentation on line 3 of here-doc doesn't match delimiter at - line 1.\n", + "indented here-doc with bad indentation" + ]; + # If our delim is " EOF ", make sure other spaced version don't match push @tests, [ "print <<~' EOF ';\n $string\n EOF\nEOF \n EOF \n EOF \n", diff --git a/toke.c b/toke.c index 5a181c3..675e136 100644 --- a/toke.c +++ b/toke.c @@ -9905,6 +9905,7 @@ S_scan_heredoc(pTHX_ char *s) if (*ss == '\n') { sv_catpv(newstr,"\n"); ss++; + linecount++; /* Found our indentation? Strip it */ } else if (se - ss >= indent_len @@ -9928,8 +9929,6 @@ S_scan_heredoc(pTHX_ char *s) (int)linecount ); } - - linecount++; } sv_setsv(tmpstr,newstr); -- Perl5 Master Repository