Skip to content
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

Improve error recovery while parsing switch expressions. #67340

Merged
merged 10 commits into from
Mar 19, 2023

Conversation

CyrusNajmabadi
Copy link
Member

Specifically, the parser tends to go off the rails when manually converting a switch statemnt to a switch expression. This makes the parser much better behaved, preventing lots of cascading errors.

@CyrusNajmabadi
Copy link
Member Author

@RikkiGibson @jjonescz ptal.

Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

Do we want to try and do anything for the opposite case? Refactoring a switch expr into a statement?

@CyrusNajmabadi
Copy link
Member Author

Do we want to try and do anything for the opposite case? Refactoring a switch expr into a statement?

If at the point i run into that problem, i'd be happy to contribute more. But i really have to timebox these things to prevent feature creep and just not having enough time for these improvements and the rest of hte stuff on my plate. For thigns like error recovery, we could spend unlimited time on things, so i'd really like to keep things targetted and specific so it's easy to make the change, test and review all at once :)

@CyrusNajmabadi
Copy link
Member Author

@RikkiGibson @jjonescz ptal. Thanks! :)

@RikkiGibson RikkiGibson self-assigned this Mar 17, 2023
@RikkiGibson
Copy link
Contributor

Really nice improvement. Thanks!

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge (squash) March 19, 2023 18:24
@CyrusNajmabadi
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@CyrusNajmabadi CyrusNajmabadi merged commit 62a4f8a into dotnet:main Mar 19, 2023
@ghost ghost added this to the Next milestone Mar 19, 2023
@CyrusNajmabadi CyrusNajmabadi deleted the switchParsing branch March 19, 2023 21:53
@allisonchou allisonchou modified the milestones: Next, 17.6 P3 Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants