-
-
Notifications
You must be signed in to change notification settings - Fork 69
Description
After seeing discussions about bumping parsers to 1.0 after tree-sitter 1.0 is released, I figured it'd be good to list what remains to be done before having full support for parsing PHP using tree-sitter. I guess most of these should be solved before tree-sitter-php is bumped to 1.0 - at least if a 1.0 release means committing to not changing the AST.
This list is compiled from testing the code of PHP release announcements (from 7.0). Thus, I might have missed something. Feel free to add it if that's the case.
Pre 7.0
- Interpolated strings (Variables that will be expanded in double quoted strings are not parsed as variables #34, PR: String interpolation #72)
- Represent references (PR: Adds support for references #106)
- Add support for interpolated string content in heredoc (PR: Adds support for interpolated strings to HEREDOC #121)
- Ensure all keywords are handled as such (documentation)
- Make 'yield' and 'yield from' distinguishable in the AST
- Handle interpolation in Execution Operators (backtick) (documentation, PR: Adds support for interpolation in execution operators. Closes #135 #146)
7.1
7.4
- Arrow functions (rfc, PR: Adds support for arrow functions from PHP 7.4 #65)
- Null coalescing assignment operator (rfc)
- Unpacking inside arrays (rfc, PR: Adds support for spread operator inside arrays from PHP 7.4 #64)
- Numeric literal separator (rfc)
8.0
- Named arguments (rfc, PR: Adds support for named arguments #67)
- Attributes (rfc, PR: Adds support for attributes #69)
- Add support for attribute groups to support round tripping and other use cases than highlighting (PR: Adds attribute_group node to complete attributes support #130)
- Constructor property promotion (rfc, PR: PHP 8: Adds support for constructor property promotion #74)
- Union types (rfc, PR: Adds support for union types #68)
- Match expression (rfc, PR: PHP8: Adds support for match expressions #73)
- Nullsafe operator (rfc, PR: PHP8: Adds support for nullsafe operator #75)
- Allow trailing comma in parameter list (rfc, PR: Adds support for trailing comma in parameter and clousure use lists as per PHP 8.0 #66)
- Allow trailing comma in closure use lists (rfc, PR: Adds support for trailing comma in parameter and clousure use lists as per PHP 8.0 #66)
- non-capturing catches - (rfc)
- throw expression (rfc, PR: PHP8: Adds support for throw expressions #76)
- Deprecate left-assossiative ternary operator (rfc)
8.1
- Enums (rfc, PR: Adds support for Enums as implemented in PHP 8.1 #89)
- Explicit octal integer literal notation (rfc, PR: Adds support for explicit octal integer literal notation #87)
- Final class constants (rfc, PR: Adds support for final class constants introduced in PHP 8.1 #88)
- Pure intersection types (rfc, PR: Adds support for intersection types #145)
- Readonly properties 2.0 (rfc, PR: Parse readonly properties #134)
- New in initializers (rfc)
- First class callable syntax (rfc, PR: Adds support for first class callable syntax #137)
- noreturn return type (rfc, PR: Adds support for the never return type from the no_return RFC #138)
In addition, there should be some house cleaning ensuring proper names on AST nodes. E.g. class_modifier is used for both classes and functions.
I'll try to get to these over time, but will not be able to get through all of them in the near future. So if anyone else wants to grab an item, I won't complain 😄