Skip to content

Remove parsing, token, and syntax nodes for # things subsumed by macros #1284

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 14 commits into from
Jan 27, 2023

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Jan 26, 2023

Remove a number of #-related things that are subsumed by macros from the parser, token list, and syntax tree:

  • #assert, an experimental feature
  • #warning and #error, to be subsumed by freestanding macros
  • #_hasSymbol, to be subsumed by a builtin expression macro
  • Vestigial tokens for #fileLiteral, #colorLiteral, and #imageLiteral

@DougGregor DougGregor requested a review from ahoppen as a code owner January 26, 2023 21:55
@DougGregor
Copy link
Member Author

@swift-ci please test

@@ -52,7 +49,7 @@ final class PoundAssertTests: XCTestCase {
#assert(1️⃣, "error message")
"""#,
diagnostics: [
DiagnosticSpec(message: "expected condition in '#assert' directive")
DiagnosticSpec(message: "expected value in pound literal declaration")
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn’t this be expected value in macro expansion? I think you need to update the name_for_diagnostics for MacroExpansionDecl.

Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose we can do that now. Previously, we decided to call them "pound literals" because we macros weren't a thing yet.

@DougGregor DougGregor changed the title Remove #assert parsing, token, and syntax node Remove parsing, token, and syntax nodes for # things subsumed by macros Jan 26, 2023
@DougGregor
Copy link
Member Author

@swift-ci please test

2 similar comments
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test

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.

Great. So much code gone 🤩

@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit 78d7bc1 into swiftlang:main Jan 27, 2023
@DougGregor DougGregor deleted the remove-pound-assert branch January 27, 2023 23:11
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