Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 57163
Status: open
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: shmuelfomberg [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.210
Fixed in: (no value)



Subject: Whitespace-only line is concatenated with the whitespaces in the beginning of the next line
Please take a look on these three cases: one: "\n foo". it will translate to two tokens: whitespace "\n " and word "foo". two: "\n \nfoo". now we will have three tokens: whitespace "\n", whitespace " \n" and word "foo". three: "foo\n foo", will translate to: word "foo", whitespace "\n", whitespace " ", word "foo". So I think that the first case is a bug, and the whitespace should be splitted to newline and the rest. For doing this, you should add in Whitespace.pm the following line: (in pseudo diff) sub __TOKENIZER__on_line_start { my $t = $_[1]; my $line = $t->{line}; # Can we classify the entire line in one go if ( $line =~ /^\s*$/ ) { # A whitespace line $t->_new_token( 'Whitespace', $line ); + $t->_finalize_token; return 0; Thanks, Shmuel.
Confirming this bug exists, verified with PPI::Tester