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

Missing "continue" type from PPI::Statement::Compound docs #228

Open
Eckankar opened this issue Sep 18, 2018 · 0 comments
Open

Missing "continue" type from PPI::Statement::Compound docs #228

Eckankar opened this issue Sep 18, 2018 · 0 comments

Comments

@Eckankar
Copy link

Eckankar commented Sep 18, 2018

In the docs for PPI::Statement::Compound, it says:

type

The type method returns the syntactic type of the compound statement.

There are four basic compound statement types.

The 'if' type includes all variations of the if and unless statements, including any 'elsif' or 'else' parts of the compound statement.

The 'while' type describes the standard while and until statements, but again does not describes simple statements with a trailing while.

The 'for' type covers the C-style for loops, regardless of whether they were declared using 'for' or 'foreach'.

The 'foreach' type covers loops that iterate over collections, regardless of whether they were declared using 'for' or 'foreach'.

All of the compounds are a variation on one of these four.

Returns the simple string 'if', 'for', 'foreach' or 'while', or undef if the type cannot be determined.

However, parsing the code { foo(); next; bar(); } gives a PPI::Statement::Compound with the type 'continue', which is not mentioned.

The docs should be updated to include the missing type.

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

1 participant