Skip to content
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

Syntax and parsing for '-define-availability' argument #2954

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Feb 4, 2025

No description provided.

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

I can’t say that I love this but I don’t have a better solution either, so good with me.

Comment on lines 23 to 27
for node in NON_BASE_SYNTAX_NODES {
if let spi = node.spi, seen.insert(spi.text).inserted {
AttributeSyntax("@_spi(\(spi))").with(\.trailingTrivia, .space)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This is repeated at least 3 times. Could we share it?

@@ -13,9 +13,9 @@
//===----------------------------------------------------------------------===//

#if compiler(>=6)
@_spi(RawSyntax) public import SwiftSyntax
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax

@rintaro rintaro force-pushed the availability-macro-definition branch from 7ae0295 to 923a242 Compare February 4, 2025 21:17
@rintaro
Copy link
Member Author

rintaro commented Feb 4, 2025

@swift-ci Please test

@rintaro rintaro marked this pull request as ready for review February 4, 2025 21:21
@rintaro rintaro requested a review from bnbarham as a code owner February 4, 2025 21:21
internal import SwiftSyntax
@_spi(RawSyntax) @_spi(ExperimentalLanguageFeatures) @_spi(Compiler) public import SwiftSyntax
Copy link
Member

Choose a reason for hiding this comment

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

The import access level changed here.

Copy link
Member Author

@rintaro rintaro Feb 4, 2025

Choose a reason for hiding this comment

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

Made it .internal by default

@rintaro rintaro force-pushed the availability-macro-definition branch 2 times, most recently from 7830845 to 624fde6 Compare February 5, 2025 03:31
Under 'Compier' SPI. This is for parsing arguments for
'-define-availability' compiler option:

  <identifier> <version-tuple>? ':' <availability-spec-list>
@rintaro rintaro force-pushed the availability-macro-definition branch from 624fde6 to a1c17fe Compare February 5, 2025 03:37
@rintaro
Copy link
Member Author

rintaro commented Feb 5, 2025

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Feb 5, 2025

@swift-ci Please test Windows

@rintaro rintaro merged commit 7a37286 into swiftlang:main Feb 5, 2025
3 checks passed
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