Create a new release, supporting php-ast AST version 40?
TysonAndre opened this issue · 2 comments
https://github.com/nikic/php-ast#40-current has been out since January 2017.
- I'm requesting support for only version 40. Backwards compatibility with 35 and 30 is not part of this request.
Things to ensure don't break (Representative snippets of php code which changed are included):
Version 40:
-
$a ?? $b;
AST_COALESCE is now represented as an AST_BINARY_OP with flag BINARY_COALESCE.
-
('\bar')()
(Valid to convert to\bar()
)the leading backslash is now dropped if syntax like ('\bar')() is used.
-
if ($x);
andwhile ($x);
null elements are now stripped from AST_STMT_LIST. Previously these could be caused by nop statements (;).
...
Many stmts children could previously hold one of null, a single node or an AST_STMT_LIST. These will now be normalized to always use an AST_STMT_LIST. A null is only allowed if it is semantically meaningful -
function foo(?iterable $x, ?callable $y, int $z, iterable $i) : callable {}
Representation of certain types was normalized to always use an AST_TYPE node
Version 35:
[$x, 'y' => $var] = $expr
andlist($x, 'y' => $var) = $expr
list()
destructuring is now always represented as an AST_ARRAY with ARRAY_SYNTAX_LIST flag.- try/catch with single/multiple class types
Thanks for the detailed issue. I believe we are now compatible with PHP 7.0, 7.1, and 7.2, along with php-ast versions 30, 35, and 40. I intend on doing a little further testing to ensure that I haven't missed anything obvious, and then I'll make a release.