PPI icon indicating copy to clipboard operation
PPI copied to clipboard

RT 30037: minus operator turns function name into two words

Open moregan opened this issue 10 years ago • 0 comments

https://rt.cpan.org/Ticket/Display.html?id=30037 With PPI 1.215:

ppidump '$a=-xx::cc()'
                    PPI::Document
                      PPI::Statement
[    1,   1,   1 ]     PPI::Token::Symbol       '$a'
[    1,   3,   3 ]     PPI::Token::Operator     '='
[    1,   4,   4 ]     PPI::Token::Word         '-xx'
[    1,   7,   7 ]     PPI::Token::Word         '::cc'
                        PPI::Structure::List    ( ... )

Without the minus you get what you'd expect:

ppidump '$a=xx::cc()'
                    PPI::Document
                      PPI::Statement
[    1,   1,   1 ]     PPI::Token::Symbol       '$a'
[    1,   3,   3 ]     PPI::Token::Operator     '='
[    1,   4,   4 ]     PPI::Token::Word         'xx::cc'
                        PPI::Structure::List    ( ... )

See also https://rt.cpan.org/Public/Bug/Display.html?id=55749, which has a lot of analysis and sample Perl code

moregan avatar Mar 13 '14 05:03 moregan