Skip to content

Remove __FILE__ et al as keywords and syntax nodes. #1135

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 5 commits into from
Dec 12, 2022

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Dec 11, 2022

__FILE__, __COLUMN__, et al were keywords prior to Swift 2, and have only been kept around as keywords to provide a custom error message to rewrite to #file, #column, etc. It's incorrect to keep them as keywords, and that error should be implemented differently if we care about it.

These keywords were the only things keeping the syntax nodes for #file et al around; the correct spellings like #file are now macro expansion expression syntax nodes. So, remove these syntax nodes as well.

These were keywords prior to Swift 2, and have only been kept around as
keywords to provide a custom error message to rewrite to `#file` et
al. It's incorrect to keep them as keywords, and that error should be
implemented differently if we care about it.
@DougGregor DougGregor requested a review from ahoppen as a code owner December 11, 2022 19:54
@DougGregor
Copy link
Member Author

swiftlang/swift#62512

@swift-ci please test

With __FILE__ et al no longer being keywords, the parser is no longer
forming these syntax nodes. They are all handled as macro expansion
expression nodes.
@DougGregor DougGregor changed the title Remove __FILE__ et al as keywords. Remove __FILE__ et al as keywords and syntax nodes. Dec 11, 2022
@DougGregor
Copy link
Member Author

swiftlang/swift#62512

@swift-ci please test

@DougGregor DougGregor merged commit 6fcc5a4 into swiftlang:main Dec 12, 2022
@DougGregor DougGregor deleted the remove-double-underscored-file branch December 12, 2022 00:59
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.

1 participant