A year in the making, PPI 1.205 is now (finally) available. This release contains large amounts of work from Elliot Shank and the Perl Critic team, some internals work from me, as well as a number of bug fixes from various people.
Notable changes for this release include.
- Complete support for Perl 5.10, include a number of new PDOM classes such PPI::Statement::Given to support given/when blocks.
- The tokenizer and lexer now use exceptions internally for error handling (however the user API has not changed) which enabled new opportunities for inlining and variable copy reduction. As a result PPI is now around 5-10% faster despite the complexity addition from 5.10 support and accuracy fixes.
- PPI's location tracking now supports virtual #line directives.
- Expanded support for the ->literal method. The term "literal" is used to describe mechanisms that safely emulate "eval" without invoking the Perl interpreter. For example, a hexidecimal number in Perl code can be ->literal'ed to get the actual value. In future releases this will be expanded to support constructs like HASH and array constructors.
- A significant API change has been implemented which splits the old for () "PPI::Structure::ForLoop" round brace structure into EITHER PPI::Structure::For if it is a a 3-statement triplet OR a PPI::Structure::List if it is a foreach-style list. To reduce back-compatibility issues, both will still response true to ->isa('PPI::Structure::ForLoop') and throw a warning (once per process for each of the two classes).
- A variety of additional PDOM utility methods such as "ancestor_of" have been pulled down from Perl::Critic specifically to make life easier for them.
- PPI now supports inline Perl 6 code via the "use v6-alpha;" pragma-like. They are supported internally in a manner similar to HEREDOCs.
- Various pathological cases been smoothed away, such as support for null-length documents, files called '0', Unicode byte order marks and so on.
- An experiment replacement for PPI::XS has been included. PPI::XSAccessor XS-accelerates a wider variety of accessors, literals and constructors compared to the old PPI::XS. You will need to install Class::XSAccessor to use this class.
Because the delta for this release is fairly high, I do expect to see some breakages. We may see some additional releases in the short term future to address any resulting issues.
If you are testing the new release, please note that PPI is currently believed to be broken on Perl's git maint branch, so you may see false negatives.