Adds support for Enums as implemented in PHP 8.1#89
Adds support for Enums as implemented in PHP 8.1#89cfroystad merged 2 commits intotree-sitter:masterfrom
Conversation
|
After looking a bit more into this, I realized that the change increased the parser line count from 111 476 to 135 526. I'm not sure what's causing this and if there's anything to be done about it. I'll see if I find the time to investigate, but if you have any hunches I'd be happy to learn! |
maxbrunsfeld
left a comment
There was a problem hiding this comment.
Sorry, I noticed a couple minor issues. Could you take a look at these comments when you get a chance?
| '}', | ||
| ), | ||
|
|
||
| _enum_member_declartaion: $ => choice( |
There was a problem hiding this comment.
Oh, there's a typo in this name.
There was a problem hiding this comment.
Fixed in the bugfixes branch
| optional(field('attributes', $.attribute_list)), | ||
| 'case', | ||
| field('name', $.name), | ||
| optional(field('value', seq('=', choice($.string, $.integer)))), |
There was a problem hiding this comment.
The value field should probably only be on the string/integer, and not on the equals sign.
There was a problem hiding this comment.
Fixed in the bugfixes branch
|
Most certainly! Both of those are almost embarrassing, so thanks for identifying them 🙂 |
RFC
This PR implements Enumerations for PHP as implemented in PHP 8.1
turns into:
An enum in PHP might have methods and implement interfaces:
turns into:
This change brings us to 100% support for PHP 8.1 (minus pending and draft PRs) scheduled for release in november 🎉
Checklist: