Skip to content

Avoid gap in AST_CLASS child nodes for attributes #6088

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

Closed
wants to merge 1 commit into from

Conversation

TysonAndre
Copy link
Contributor

See nikic/php-ast#181

Hm, I'm thinking it would make more sense to change the structure in php-src.
All the function types have consistent AST structure, but there's no reason at
all why classes should be consistent with functions.

It's unusual to have an unused child node between other child nodes that are
used (for name, extends, implements, and attributes of AST_CLASS)

See nikic/php-ast#181

> Hm, I'm thinking it would make more sense to change the structure in php-src.
> All the function types have consistent AST structure, but there's no reason at
> all why classes should be consistent with functions.

It's unusual to have an unused child node between other child nodes that are
used (for name, extends, implements, and attributes of AST_CLASS)
@TysonAndre
Copy link
Contributor Author

FYI @beberlei - this amends a7908c2

@beberlei
Copy link
Contributor

beberlei commented Sep 9, 2020

Oops :) /cc @kooldev

@kooldev
Copy link
Contributor

kooldev commented Sep 10, 2020

Looks fine to me. That gap is a leftover from a previous refactoring. An earlier version of attributes extended zend_ast_decl with a new member called attributes and therefore did not need to handle functions and classes in different ways.

@php-pulls php-pulls closed this in 0990424 Sep 10, 2020
@TysonAndre TysonAndre deleted the class-attributes-index-3 branch November 25, 2021 21:33
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.

4 participants