Skip to content

[ASTGen] TokenSyntax.keyworkKind to directly get Keyword kind #70292

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 1 commit into from
Dec 7, 2023

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Dec 7, 2023

This should be faster than e.g. token.tokenKind == .keyword(.true).

@rintaro
Copy link
Member Author

rintaro commented Dec 7, 2023

@swift-ci Please smoke test

@rintaro rintaro requested review from hamishknight and removed request for CodaFi and zoecarver December 7, 2023 07:38
Comment on lines +432 to +435
switch keyword {
case .none?: self = .none
case .left?: self = .left
case .right?: self = .right
Copy link
Member Author

Choose a reason for hiding this comment

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

Just .none tries to match against Optional<Keyword>.none

@rintaro rintaro force-pushed the astgen-keywordkind branch 2 times, most recently from d1c1564 to 02f015a Compare December 7, 2023 08:19
This should be faster than e.g. `token.tokenKind == .keyword(.true)`.
@rintaro rintaro force-pushed the astgen-keywordkind branch from 02f015a to a12113a Compare December 7, 2023 08:24
@rintaro
Copy link
Member Author

rintaro commented Dec 7, 2023

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Dec 7, 2023

@swift-ci Please smoke test Windows

@rintaro rintaro merged commit 81d19df into swiftlang:main Dec 7, 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.

3 participants