Skip to content

[ASTGen] Implement Patterns #70387

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

Merged
merged 2 commits into from
Dec 12, 2023
Merged

[ASTGen] Implement Patterns #70387

merged 2 commits into from
Dec 12, 2023

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Dec 11, 2023

Expect MissingPatternSyntax.

@rintaro
Copy link
Member Author

rintaro commented Dec 11, 2023

@swift-ci Please smoke test

@rintaro rintaro requested review from bnbarham, ahoppen and hamishknight and removed request for xedin, slavapestov, CodaFi, hborla and zoecarver December 11, 2023 20:35
}

func generate(tuplePattern node: TuplePatternSyntax) -> BridgedPattern {
if node.elements.count == 1 && node.elements.first!.label == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if node.elements.count == 1 && node.elements.first!.label == nil {
if node.elements.count == 1, let firstElement = node.elements.first, firstElement.label == nil {

And then firstElement can be re-used further down (firstElement.pattern).

Comment on lines +1147 to +1149
BridgedIdentifier Label;
BridgedSourceLoc LabelLoc;
BridgedPattern ThePattern;
Copy link
Contributor

Choose a reason for hiding this comment

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

Lowercase?

Copy link
Member Author

Choose a reason for hiding this comment

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

We are inconsistent. Let's clean them up later.

Except `MissingPatternSyntax`
@rintaro
Copy link
Member Author

rintaro commented Dec 11, 2023

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Dec 12, 2023

@swift-ci Please smoke test Linux

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Dec 12, 2023

@swift-ci Please smoke test Linux

@rintaro rintaro merged commit b6137dd into swiftlang:main Dec 12, 2023
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