Perl-Critic / PPI

54 stars 44 forks source link

for (;<$foo>;) misparsed #235

Closed Grinnz closed 5 years ago

Grinnz commented 5 years ago

In the C-style for loop, <$foo> in the middle argument is misparsed as two operators surrounding a token rather than a readline quotelike. <FOO> as well.

  PPI::Statement::Compound
    PPI::Token::Word    'for'
    PPI::Token::Whitespace      ' '
    PPI::Structure::For         ( ... )
      PPI::Statement::Null
        PPI::Token::Structure   ';'
      PPI::Statement
        PPI::Token::Operator    '<'
        PPI::Token::Word        'DATA'
        PPI::Token::Operator    '>'
        PPI::Token::Structure   ';'
    PPI::Token::Whitespace      ' '
    PPI::Structure::Block       { ... }
wchristian commented 5 years ago

This is fixed in https://metacpan.org/release/MITHALDU/PPI-1.254