Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHECK bareword handle parsed as scheduled statement #246

Open
Grinnz opened this issue Jun 25, 2019 · 1 comment
Open

CHECK bareword handle parsed as scheduled statement #246

Grinnz opened this issue Jun 25, 2019 · 1 comment

Comments

@Grinnz
Copy link
Contributor

Grinnz commented Jun 25, 2019

From Grinnz/Perl-Critic-Community#33:

> cat minimal
#!/usr/bin/perl

open(CHECK, '/foo');

> ppi_dumper minimal 
PPI::Document
  PPI::Token::Comment   '#!/usr/bin/perl\n'
  PPI::Token::Whitespace        '\n'
  PPI::Statement
    PPI::Token::Word    'open'
    PPI::Structure::List        ( ... )
      PPI::Statement::Scheduled
        PPI::Token::Word        'CHECK'
        PPI::Token::Operator    ','
        PPI::Token::Whitespace          ' '
        PPI::Token::Quote::Single       ''/foo''
    PPI::Token::Structure       ';'
  PPI::Token::Whitespace        '\n'

It should not be possible for statements to start in this structure - I can confirm it also happens for other scheduled statement keywords like BEGIN and INIT.

@trwyant
Copy link
Contributor

trwyant commented Feb 7, 2020

Pull request just made. Not sure I held my tongue right to connect it to this issue. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants