Skip to content

Miscellaneous parser fixes #734

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 6 commits into from
Sep 8, 2022
Merged

Conversation

DougGregor
Copy link
Member

Fix a number of small issues encountered while parsing the standard library:

  • Don't lex regex literals with unbalanced close parentheses in them (/a)/)
  • Lex hexadecimal floating point literals
  • Properly parse the @rethrows attribute
  • Parse #fileID
  • Parse @differentiable on types

@DougGregor DougGregor requested a review from ahoppen as a code owner September 8, 2022 06:23
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit d493f0f into swiftlang:main Sep 8, 2022
@DougGregor DougGregor deleted the misc-parser-fixes branch September 8, 2022 12:42
func testRethrowsAttribute() {
AssertParse(
"""
@rethrows
Copy link
Member

Choose a reason for hiding this comment

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

Is @rethrows a valid attribute? Do we need to handle @try or other keywords as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, @rethrows is a valid attribute, which applies only to protocols. It should have been an underscored feature because it's not really done yet, but we messed up.

Copy link
Member

Choose a reason for hiding this comment

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

I see. In that case you probably want to remap rethrows to an identifier when consuming it, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a great point! I'll do that in a follow-up PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Finally did this: #818

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.

3 participants