Skip to content

Remove recover methods from the parser #655

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 3 commits into from
Aug 31, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 30, 2022

Instead of sticking unexpected tokens into errorTokens of a CodeBlock, we should be putting them into the tree as unexpected nodes, where they can be diagnosed. These unexpected nodes are typically created by Parser.expect calls.

@ahoppen
Copy link
Member Author

ahoppen commented Aug 31, 2022

swiftlang/swift#60847

@swift-ci Please test

@ahoppen ahoppen force-pushed the ahoppen/no-legacy-recovery branch from cb63b7f to 43b1b42 Compare August 31, 2022 16:10
@ahoppen ahoppen force-pushed the ahoppen/no-legacy-recovery branch from 43b1b42 to b8a0e43 Compare August 31, 2022 18:14
Recovery should be handled as unexpected nodes, which are usually produced by `expect`.
@ahoppen ahoppen force-pushed the ahoppen/no-legacy-recovery branch from b8a0e43 to 42c3af5 Compare August 31, 2022 18:58
@ahoppen ahoppen marked this pull request as ready for review August 31, 2022 19:27
@ahoppen
Copy link
Member Author

ahoppen commented Aug 31, 2022

@swift-ci Please test

Copy link
Contributor

@CodaFi CodaFi left a comment

Choose a reason for hiding this comment

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

We'll take it for now. There's some tricky cases especially with extraneous right braces that this won't handle correctly.

@ahoppen ahoppen merged commit d321b74 into swiftlang:main Aug 31, 2022
@ahoppen ahoppen deleted the ahoppen/no-legacy-recovery branch August 31, 2022 21:00
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