Skip to content

[5.9][Macros] Copy MacroSystem and related code to SwiftSyntaxMacroExpansion #1868

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jun 29, 2023

Cherry-pick #1858 into release/5.9

  • Explanation: MacroSystem (i.e. SyntaxProtocol.expand(macros:in:)) is a syntactic macro expansion utility for testing macros (i.e. assertMacroExpansion()) It should be moved to SwiftSyntaxMacroExpansion module because it's a expansion utility, and should share the same code with other expansion functions including the actual compiler expansion. To help migration from SwiftSyntaxMacros to SwiftSyntaxMacroExpansion, just copy it and deprecate the old one in SwiftSyntaxMacros
  • Scope: Macro expansion testing
  • Risk: Low. Just adding new codes, and deprecating existing symbols
  • Testing: Passes existing test suite
  • Issue: rdar://111539312
  • Reviewer: Ben Barham (@bnbarham) Doug Gregor (@DougGregor)

@rintaro
Copy link
Member Author

rintaro commented Jun 29, 2023

@swift-ci Please test

And deperecate the original in SwiftSyntaxMacros module.

'MacroSystem' (i.e. 'SyntaxProtocol.expand(macros:in:)') is a syntactic
macro expansion utility for testing macros (i.e. assertMacroExpansion())
It should be moved to `SwiftSyntaxMacroExpansion` module because it's a
_expansion_ utility, and should share the same code with other
expansion functions including the actual compiler expansion.

(cherry picked from commit fabcf50)
@rintaro rintaro force-pushed the 5.9-macros-macrossystem-expansion branch from f4d65fa to 972f60e Compare June 30, 2023 03:37
@rintaro
Copy link
Member Author

rintaro commented Jun 30, 2023

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Jun 30, 2023

@swift-ci Please test Windows

@rintaro rintaro merged commit 3609c77 into swiftlang:release/5.9 Jun 30, 2023
@rintaro rintaro deleted the 5.9-macros-macrossystem-expansion branch June 30, 2023 21:48
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