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

Allow abstract declarator "static" (GH issue #539) #545

Merged
merged 1 commit into from
Jun 23, 2024

Conversation

gperciva
Copy link
Contributor

@gperciva gperciva commented Jun 19, 2024

This is similar to:

allow "static" in array parameters (GH issue #21)
aac7b27

which was revised shortly after in:

Fuller support for qualifiers in array dimensions.
8aad318

The grammar is as defined in C99 6.7.6 Type names, or A.2.2 Declarations (6.7.6).

This is similar to:
    allow "static" in array parameters (GH issue eliben#21)
    aac7b27
which was revised shortly after in:
    Fuller support for qualifiers in array dimensions.
    8aad318

The grammar is as defined in C99 6.7.6 Type names, or
A.2.2 Declarations (6.7.6).
@gperciva
Copy link
Contributor Author

I debated between adding p_direct_abstract_declarator_8(), vs. stuffing it in p_direct_abstract_declarator_3().

Putting it in _3 would keep the grammar in the same order as 6.7.6 -- namely, the static functions going between direct-abstract-declarator_opt [ type-qualifier-list_opt assignment-expression_opt ] and direct-abstract-declarator_opt [ * ]. However, when parsing the static as well, the _3() we get len(p) == 6, which is slightly awkward to handle in a function with currently has separate paths for len(p) > 4 or not.

In the end I put it in a new p_direct_abstract_declarator_8(), but I'm happy to revise that if requested.

@eliben eliben merged commit ab00af8 into eliben:main Jun 23, 2024
12 checks passed
@gperciva gperciva deleted the abstract-declarator-static branch June 23, 2024 19:35
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