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

Indicate anonymous classes allow optional trailing commas in arg list #260

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ramsey
Copy link
Member

@ramsey ramsey commented Feb 24, 2024

No description provided.

@@ -616,6 +616,7 @@ object-creation-expression:
'new' class-type-designator '(' argument-expression-list ','? ')'
'new' class-type-designator
'new' 'class' '(' argument-expression-list? ')' class-base-clause? class-interface-clause? '{' class-member-declarations? '}'
'new' 'class' '(' argument-expression-list ','? ')' class-base-clause? class-interface-clause? '{' class-member-declarations? '}'
Copy link
Member

Choose a reason for hiding this comment

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

I believe this should either use ',' without ?, or the existing line should be extended with ','?. Otherwise, the two productions are ambiguous, code without the comma can be parsed by either. I see this is already wildly inconsistent in the grammar, so maybe I'm missing something.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe? I was trying to follow the patterns I saw elsewhere in the grammar, but I can't find any information on the specification for the grammar we use, so it's difficult to understand what is meant or intended in places.

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