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

Adds support for final class constants introduced in PHP 8.1 #88

Merged
merged 2 commits into from
Jun 22, 2021

Conversation

cfroystad
Copy link
Collaborator

@cfroystad cfroystad commented Jun 19, 2021

rfc

This PR adds support for final class constants, as implemented in PHP 8.1.

example:

class Foo
{
    final public const X = "foo";
}

I also took the opportunity to break up the class_modifier node since it's inappropriately named with regard to its use and other similar constructs in the parser (e.g. static_modifier, var_modifer, visibility_modifier, etc.)

class_modifier has been replaced by abstract_modifier and final_modifier wrapped in a modifier-field.

Checklist:

  • All tests pass in CI
  • There are sufficient tests for the new fix/feature
  • Grammar rules have not been renamed unless absolutely necessary (2 rules renamed - see explanation above)
  • The conflicts section hasn't grown too much (0 new conflicts)
  • The parser size hasn't grown too much (master: 1210, PR: 2116)

@cfroystad cfroystad mentioned this pull request Jun 19, 2021
32 tasks
@maxbrunsfeld
Copy link
Contributor

Thanks!

@cfroystad cfroystad merged commit 5e89808 into tree-sitter:master Jun 22, 2021
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

Successfully merging this pull request may close these issues.

2 participants