diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-09-01 13:49:33 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-09-01 14:20:57 -0700 |
commit | 65c68e17188d09c96250348d769c0c309500d5b9 (patch) | |
tree | ca5f67ed745c925d0c5b81935ff4c6e8ebf34cd8 /t/comp/line_debug_0.aux | |
parent | 5239c153d07c7f3ed720062743a8b89ae671a95f (diff) | |
download | perl-65c68e17188d09c96250348d769c0c309500d5b9.tar.gz |
Fix debugger lines with keyword <newline> =>
Commit 2179133 (in 5.19.2) modified the parser to look past newlines
when searching for => after a keyword. In doing so, it stopped the
parser from saving lines correctly for the debugger:
$ PERL5DB='sub DB::DB{}' perl5.18.1 -detime -e'=>;' -e 'print @{"_<-e"}'
sub DB::DB{};
time
=>;
print @{"_<-e"}
$ PERL5DB='sub DB::DB{}' perl5.19.3 -detime -e'=>;' -e 'print @{"_<-e"}'
sub DB::DB{};
=>;
print @{"_<-e"}
Notice how line 1 is missing in 5.19.3.
When peeking ahead past the end of the line, lex_read_space does need
to avoid incrementing the line number from the caller’s (yylex’s) per-
spective, but it still needs to increment it for lex_next_chunk to put
the lines for the debugger in the right slot. So this commit changes
lex_read_space to increment the line number but set it back again
after calling lex_next_chunk.
Another problem was that the buffer pointer was being restored for a
keyword followed by a line break, but only if there was *no* fat arrow
on the following line.
Diffstat (limited to 't/comp/line_debug_0.aux')
-rw-r--r-- | t/comp/line_debug_0.aux | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/t/comp/line_debug_0.aux b/t/comp/line_debug_0.aux index 2d31d747aa..c4193e224d 100644 --- a/t/comp/line_debug_0.aux +++ b/t/comp/line_debug_0.aux @@ -18,3 +18,6 @@ format Z = $z . $z = 'line twenty'; +$z = time +=>; +$z++; |