-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Conversation
@RikkiGibson @jjonescz ptal. |
There was a problem hiding this 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?
src/Compilers/CSharp/Test/Syntax/Parsing/SwitchExpressionParsingTests.cs
Show resolved
Hide resolved
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 :) |
@RikkiGibson @jjonescz ptal. Thanks! :) |
src/Compilers/CSharp/Portable/Parser/LanguageParser_Patterns.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Syntax/Parsing/SwitchExpressionParsingTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Syntax/Parsing/SwitchExpressionParsingTests.cs
Outdated
Show resolved
Hide resolved
Really nice improvement. Thanks! |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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.