Skip to content

[gyb_syntax_support] No longer require trailing space after expression-like keywords #60502

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
Aug 12, 2022

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Aug 11, 2022

This patch sets requires_trailing_space to False for all ExprKeywords that can be used directly as expressions, to enable formatting that is consistent with identifiers in swift-syntax. In particular, the following keywords no longer require a trailing space:

  • nil
  • true, false
  • super, self, Self

See swiftlang/swift-syntax#552 for some further details.

@fwcd fwcd requested a review from ahoppen August 11, 2022 01:54
@fwcd
Copy link
Member Author

fwcd commented Aug 11, 2022

@swift-ci please test

@ahoppen
Copy link
Member

ahoppen commented Aug 11, 2022

@swift-ci please test macOS

@fwcd
Copy link
Member Author

fwcd commented Aug 11, 2022

Interesting, the CI failure seems to be that the gyb-generated files in SyntaxFactory no longer match the new trailing spaces. Isn't this kind of a cyclic dependency, i.e. we need the updated gyb_syntax_support to regenerate SyntaxFactory and vice versa?

@ahoppen
Copy link
Member

ahoppen commented Aug 11, 2022

Yes, you need to re-generate the SyntaxFactory with the updated gyb_syntax_support and create a PR for the changes. But it’s not a cyclic dependency, it’s just that SyntaxFactory depends on gyb_syntax_support.

@fwcd
Copy link
Member Author

fwcd commented Aug 11, 2022

swiftlang/swift-syntax#573

@swift-ci please test

2 similar comments
@fwcd
Copy link
Member Author

fwcd commented Aug 11, 2022

swiftlang/swift-syntax#573

@swift-ci please test

@fwcd
Copy link
Member Author

fwcd commented Aug 11, 2022

swiftlang/swift-syntax#573

@swift-ci please test

@fwcd fwcd merged commit eb7a23f into swiftlang:main Aug 12, 2022
@fwcd fwcd deleted the gyb-syntax-keyword-trailing-space branch August 12, 2022 02:00
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