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

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

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



Subject: PPI incorrectly treats the {} in do_something({ %options }) as a block
PPI incorrectly treats the {} in do_something({ %options }) as a block not a hash constructor. This causes Perl::Critic to complain about "Comma used to separate statements". perl -v This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-thread-multi perl -MPPI -E 'say $PPI::VERSION' 1.215 perl -MPPI::Document -MPPI::Dumper -e 'PPI::Dumper->new( PPI::Document->new(\"do_something({ %options, options => 1 });") )->print' PPI::Document PPI::Statement PPI::Token::Word 'do_something' PPI::Structure::List ( ... ) PPI::Statement::Compound PPI::Structure::Block { ... } PPI::Token::Whitespace ' ' PPI::Statement PPI::Token::Symbol '%options' PPI::Token::Operator ',' PPI::Token::Whitespace ' ' PPI::Token::Word 'options' PPI::Token::Whitespace ' ' PPI::Token::Operator '=>' PPI::Token::Whitespace ' ' PPI::Token::Number '1' PPI::Token::Whitespace ' ' PPI::Token::Structure ';' versus this which makes it a constructor as expected. perl -MPPI::Document -MPPI::Dumper -e 'PPI::Dumper->new( PPI::Document->new(\"do_something(+{ %options, options => 1 });") )->print' PPI::Document PPI::Statement PPI::Token::Word 'do_something' PPI::Structure::List ( ... ) PPI::Statement::Expression PPI::Token::Operator '+' PPI::Structure::Constructor { ... } PPI::Token::Whitespace ' ' PPI::Statement PPI::Token::Symbol '%options' PPI::Token::Operator ',' PPI::Token::Whitespace ' ' PPI::Token::Word 'options' PPI::Token::Whitespace ' ' PPI::Token::Operator '=>' PPI::Token::Whitespace ' ' PPI::Token::Number '1' PPI::Token::Whitespace ' ' PPI::Token::Structure ';'
This issue is now being tracked on GitHub as https://github.com/adamkennedy/PPI/issues/68