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: 75921
Status: open
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

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



Subject: Misparsing map followed by regexp containing "
Download (untitled) / with headers
text/plain 1.2k
(sent here from the Perl::Critic bug tracker, rt #75920) Here's a program that PPI parses wrongly: map { 0 } /"/ PPI thinks there is a doublequoted string but this is just a regexp match for the " character. Here is a more elaborate example demonstrating that perl treats it as a regexp but PPI does not: % cat test use 5.010; $_ = '"""'; @a = map { 0 } /"/g; say "@a"; % perl test 0 0 0 % perl -MPPI -MPPI::Dumper -E 'my $p = new PPI::Document "test"; my $d = new PPI::Dumper $p; $d->print' PPI::Document PPI::Statement::Include PPI::Token::Word 'use' PPI::Token::Whitespace ' ' PPI::Token::Number::Float '5.010' PPI::Token::Structure ';' PPI::Token::Whitespace '\n' PPI::Statement PPI::Token::Magic '$_' PPI::Token::Whitespace ' ' PPI::Token::Operator '=' PPI::Token::Whitespace ' ' PPI::Token::Quote::Single ''"""'' PPI::Token::Structure ';' PPI::Token::Whitespace '\n' PPI::Statement PPI::Token::Symbol '@a' PPI::Token::Whitespace ' ' PPI::Token::Operator '=' PPI::Token::Whitespace ' ' PPI::Token::Word 'map' PPI::Token::Whitespace ' ' PPI::Structure::Block { ... } PPI::Token::Whitespace ' ' PPI::Statement PPI::Token::Number '0' PPI::Token::Whitespace ' ' PPI::Token::Whitespace ' ' PPI::Token::Operator '/' PPI::Token::Quote::Double '"/g;\nsay "' PPI::Token::Symbol '@a' PPI::Token::Quote::Double '";\n'
Sorry, linebreaks got mangled, but you see the idea.
This issue is now being tracked on GitHub as https://github.com/adamkennedy/PPI/issues/67


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.