Skip to content

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

Merged
cfroystad merged 2 commits intotree-sitter:masterfrom
cfroystad:final_class_constants
Jun 22, 2021
Merged

Adds support for final class constants introduced in PHP 8.1#88
cfroystad merged 2 commits intotree-sitter:masterfrom
cfroystad:final_class_constants

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