[5.9][Macro] Attributes for freestanding macro expansion#65990
Merged
DougGregor merged 5 commits intoswiftlang:release/5.9from May 18, 2023
Merged
[5.9][Macro] Attributes for freestanding macro expansion#65990DougGregor merged 5 commits intoswiftlang:release/5.9from
DougGregor merged 5 commits intoswiftlang:release/5.9from
Conversation
* Parse `#<identifier>` attribute list as a `MacroExpansionDecl` regardless of the position * Diagnose whitespaces between `#` and the macro name. * Correctly attach attributes to `MacroExpansionDecl` * Fix `OrigDeclAttributes` to handle modifiers (use `getLocation()` instead of `AtLoc`.) Type checking is a TODO rdar://107386648 (cherry picked from commit 9fc1521)
Share the same expansion logic between ASTGen and SwiftCompilerMessageHandling (cherry picked from commit 5fe2ead)
(cherry picked from commit aa4504e)
(cherry picked from commit 7c2a73e)
* Unify macro expansion parsing logic between MacroExpansionExpr and MacroExpansionDecl * Diagnose whitespace between '#' and the macro name * Diagnose keyword as a macro name (cherry picked from commit e3a0f24)
Member
Author
|
swiftlang/swift-syntax#1675 |
DougGregor
approved these changes
May 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick #65815, #65882, #65932, #65959, and #65967 into
release/5.9@availableattributes are respected in the arguments of the expansion syntax e.g.@available(macOS 99, *) #someMacro(someAPIfromMacOS_99()).