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: 19629
Status: resolved
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: cpan [...] clotho.com
Cc:
AdminCc:

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



Subject: End of list mistakenly seen as end of statement
The following code fragment ($a || 0) || ($b || 0) is parsed as follows: PPI::Document PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$a' PPI::Token::Operator '||' PPI::Token::Number '0' PPI::Statement PPI::Token::Operator '||' PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$b' PPI::Token::Operator '||' PPI::Token::Number '0' I believe that instead it should be something more like this: PPI::Document PPI::Statement PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$a' PPI::Token::Operator '||' PPI::Token::Number '0' PPI::Token::Operator '||' PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$b' PPI::Token::Operator '||' Without the leading parens, the statement is instead parsed as expected: $a || 0 || ($b || 0) becomes (correctly) PPI::Document PPI::Statement PPI::Token::Symbol '$a' PPI::Token::Operator '||' PPI::Token::Number '0' PPI::Token::Operator '||' PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$b' PPI::Token::Operator '||' PPI::Token::Number '0' PPI::Token::Number '0'
Added test case for this bug, so it has to get fixed before 1.115
From: cdolan [...] cpan.org
The previous example is now fixed, but here's another manifestation of this bug. The following code {($a || 0) || ($b || 0)} generates this tree: PPI::Document PPI::Structure::Block { ... } PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$a' PPI::Token::Operator '||' PPI::Token::Number '0' PPI::Statement PPI::Token::Operator '||' PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$b' PPI::Token::Operator '||' PPI::Token::Number '0' The tree should instead look like this: PPI::Document PPI::Structure::Block { ... } PPI::Statement PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$a' PPI::Token::Operator '||' PPI::Token::Number '0' PPI::Token::Operator '||' PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Symbol '$b' PPI::Token::Operator '||' PPI::Token::Number '0' This problem arises in the real world in sort blocks. -- Chris
From: cdolan [...] cpan.org
I just committed r794 to the PPI svn which resolves this problem for lists inside of blocks. So, this ticket can be closed. -- Chris
Fixed, will appear in 1.16