-
Notifications
You must be signed in to change notification settings - Fork 433
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
Parse most of the #
things (#line
, #keyPath
, #colorLiteral
, etc.) as macro expansion expressions
#1123
Closed
Conversation
This file contains 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
@swift-ci please test |
ahoppen
approved these changes
Dec 7, 2022
Instead, they'll be parsed as a macro expansion expression.
... along with __LINE__, __FILE__, etc., which have no business being keywords. This can be handled in semantic analysis.
2edf2be
to
768cc39
Compare
@swift-ci please test |
And... this breaks swift-format: user/build/buildbot_incremental/unified-swiftpm-build-linux-x86_64/x86_64-unknown-linux-gnu/release/SwiftFormatRules.build/ValidateDocumentationComments.swift.o -o /home/build-user/build/buildbot_incremental/unified-swiftpm-build-linux-x86_64/x86_64-unknown-linux-gnu/release/SwiftFormatRules.build/VarDeclSyntax+Convenience.swift.o/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:1212:31: error: cannot find type 'ObjcKeyPathExprSyntax' in scope override func visit(_ node: ObjcKeyPathExprSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:1212:17: error: method does not override any method from its superclass override func visit(_ node: ObjcKeyPathExprSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:1216:31: error: cannot find type 'ObjectLiteralExprSyntax' in scope override func visit(_ node: ObjectLiteralExprSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:1216:17: error: method does not override any method from its superclass override func visit(_ node: ObjectLiteralExprSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:1411:31: error: cannot find type 'ObjcSelectorExprSyntax' in scope override func visit(_ node: ObjcSelectorExprSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:1411:17: error: method does not override any method from its superclass override func visit(_ node: ObjcSelectorExprSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2008:31: error: cannot find type 'ObjcNamePieceSyntax' in scope override func visit(_ node: ObjcNamePieceSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2008:17: error: method does not override any method from its superclass override func visit(_ node: ObjcNamePieceSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2012:31: error: cannot find type 'PoundFileExprSyntax' in scope override func visit(_ node: PoundFileExprSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2012:17: error: method does not override any method from its superclass override func visit(_ node: PoundFileExprSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2016:31: error: cannot find type 'PoundLineExprSyntax' in scope override func visit(_ node: PoundLineExprSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2016:17: error: method does not override any method from its superclass override func visit(_ node: PoundLineExprSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2111:31: error: cannot find type 'PoundColumnExprSyntax' in scope override func visit(_ node: PoundColumnExprSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2111:17: error: method does not override any method from its superclass override func visit(_ node: PoundColumnExprSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2176:31: error: cannot find type 'PoundFunctionExprSyntax' in scope override func visit(_ node: PoundFunctionExprSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2176:17: error: method does not override any method from its superclass override func visit(_ node: PoundFunctionExprSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2245:31: error: cannot find type 'PoundDsohandleExprSyntax' in scope override func visit(_ node: PoundDsohandleExprSyntax) -> SyntaxVisitorContinueKind { ^~~~~~~~~~~~~~~~~~~~~~~~/home/build-user/swift-format/Sources/SwiftFormatPrettyPrint/TokenStreamCreator.swift:2245:17: error: method does not override any method from its superclass override func visit(_ node: PoundDsohandleExprSyntax) -> SyntaxVisitorContinueKind { ~~~~~~~~ ^FAIL: Building swift-format failed |
Much of this is getting subsumed into #1132 |
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.
All of these custom expression kinds can be represented by macro expansion expressions, so drop their custom syntax nodes and parsing logic and use the general macro-expansion expression nodes.