-
Notifications
You must be signed in to change notification settings - Fork 440
[SwiftParser] Handle extraneous case keyword after comma in switch case. #2665
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great!
@swift-ci Please test |
Head branch was pushed to by a user without write access
Oops! That test didn't fail for me locally, but I see the problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick fix. Could you also squash your commits? We generally prefer that (https://github.com/apple/swift-syntax/blob/main/CONTRIBUTING.md#authoring-commits)
arena: self.arena | ||
) | ||
} else { | ||
unexpectedPrePatternCase = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change indentation to 2 spaces by running swift-format (https://github.com/apple/swift-syntax/blob/main/CONTRIBUTING.md#formatting)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Sorry about the sloppiness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a problem at all.
@swift-ci Please test |
By the way, the test didn’t fail locally for you because CI runs test case mutation which isn’t enabled by default. https://github.com/apple/swift-syntax/blob/main/CONTRIBUTING.md#test-case-mutation has a little more documentation about it. |
@swift-ci Please test |
For errors of the form
case .a, case .b:
instead of the expectedcase .a, .b:
, produce just a single initial unexpected token in the secondSwitchCaseItemSyntax
instead of a bad pattern and then a second separate full case.See swiftlang/swift#74071, which is essentially the same change made to the old parser.