[go: up one dir, main page]

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

Support php 8.1 intersection types #208

Merged
merged 4 commits into from
Jul 7, 2021

Conversation

TysonAndre
Copy link
Collaborator
@TysonAndre TysonAndre commented Jun 3, 2021

Support https://wiki.php.net/rfc/pure-intersection-types and the final class constant modifier

This will only be merged if the RFC is approved and the implementation
is merged into php 8.1

https://wiki.php.net/rfc/pure-intersection-types
@TysonAndre TysonAndre changed the title Support proposed php 8.1 intersection types Support php 8.1 intersection types Jul 5, 2021
@TysonAndre TysonAndre requested a review from nikic July 5, 2021 18:19
ast.c Outdated
{ ZEND_AST_CLASS_CONST_DECL, 1, visibility_flags },
{ ZEND_AST_CLASS_CONST_GROUP, 1, visibility_flags },
{ ZEND_AST_CLASS_CONST_DECL, 1, class_const_flags },
{ ZEND_AST_CLASS_CONST_GROUP, 1, class_const_flags },
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this is pre-existing, but why does CONST_DECL have class_const_flags? Aren't they always on the GROUP?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AST_CLASS_CONST_GROUP class, attributes // version 80+

CLASS_CONST_GROUP was added in version 80 to support attributes, because CONST_DECL->children is a list of nodes - earlier versions have no GROUP at all

ast.c Outdated
@@ -274,6 +274,12 @@ static const char *visibility_flags[] = {
NULL
};

static const char *class_const_flags[] = {
AST_VISIBILITY_FLAGS,
AST_FLAG(MODIFIER_FINAL),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, as far as parsing is concerned, it's possible for all AST_MODIFIER_FLAGS to occur here. STATIC/ABSTRACT are rejected during compilation. Maybe we want to skip the distinction between modifier_flags and class_const_flags?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to skip the distinction between modifier_flags and class_const_flags?

Makes sense

@TysonAndre TysonAndre requested a review from nikic July 6, 2021 18:16
@TysonAndre TysonAndre merged commit 83c769f into nikic:master Jul 7, 2021
@TysonAndre TysonAndre deleted the intersection-support branch July 7, 2021 13:06
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