Perl-Critic / PPI

54 stars 44 forks source link

Support postfix dereference #207

Closed akiym closed 5 years ago

akiym commented 7 years ago

This resolves #88

$foo->@*

before:

PPI::Document
  PPI::Statement
    PPI::Token::Symbol          '$foo'
    PPI::Token::Operator        '->'
    PPI::Token::Magic   '@*'

after:

PPI::Document
  PPI::Statement
    PPI::Token::Symbol          '$foo'
    PPI::Token::Operator        '->'
    PPI::Token::Cast    '@*'

$foo->**

before:

PPI::Document
  PPI::Statement
    PPI::Token::Symbol          '$foo'
    PPI::Token::Operator        '->'
    PPI::Token::Operator        '**'

after:

PPI::Document
  PPI::Statement
    PPI::Token::Symbol          '$foo'
    PPI::Token::Operator        '->'
    PPI::Token::Cast    '**'

$foo->%["bar"]

before:

PPI::Document
  PPI::Statement
    PPI::Token::Symbol          '$foo'
    PPI::Token::Operator        '->'
    PPI::Token::Operator        '%'
    PPI::Structure::Constructor         [ ... ]
      PPI::Statement
        PPI::Token::Quote::Double       '"bar"'

after:

PPI::Document
  PPI::Statement
    PPI::Token::Symbol          '$foo'
    PPI::Token::Operator        '->'
    PPI::Token::Cast    '%'
    PPI::Structure::Subscript   [ ... ]
      PPI::Statement::Expression
        PPI::Token::Quote::Double       '"bar"'
akiym commented 7 years ago

@wchristian how about this p-r?

xsawyerx commented 6 years ago

Ping ping. Hitting this in an important case.

wchristian commented 6 years ago

You wouldn't want me to work on code today. Will review and merge+release tomorrow if it goes clean.

wchristian commented 6 years ago

Ok, got lost in a lot of release engineering stuff.

Put it up as a dev release: https://metacpan.org/release/MITHALDU/PPI-1.237_001

Please give it a good shakedown and let me know if it's good for you.

wchristian commented 6 years ago

I see two thumbs up, am i supposed to read those as "ran the code against our stuff and it works"?

akiym commented 6 years ago

Yes. PPI, Perl::Critic and App::PRT are working correctly to me and passed these tests on PPI@1.237_001.

akiym commented 6 years ago

Ping?

xsawyerx commented 6 years ago

@akiym This seems to be conflicting some files now. Any chance you could rebase it? It would make it much easier to merge.

akiym commented 6 years ago

@xsawyerx wchristian already cherry-picked into master for releasing 1.237_001 DEV. It's ready for 1.237!

akiym commented 5 years ago

cherry-picked by 902d4095c00c6689caaace4469cf51ed0feb25ab