-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 parsing recovery with 'file' keyword #76185
Improve parsing recovery with 'file' keyword #76185
Conversation
@dotnet/roslyn-compiler @RikkiGibson ptal. |
@dotnet/roslyn-compiler @RikkiGibson ptal. Thanks! |
while (true) | ||
{ | ||
if (this.CurrentToken.Kind == SyntaxKind.OpenBraceToken || | ||
((_termState & TerminatorState.IsEndOfRecordOrClassOrStructOrInterfaceSignature) != 0 && this.CurrentToken.Kind == SyntaxKind.SemicolonToken) || |
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.
_termState check was unnecessary. Assert and comment added at start of method to explain why.
{ | ||
UsingTree(""" | ||
class C : B | ||
file class D |
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.
I imagine a similar, more contrived case may also be positively impacted
class Outer
{
class C : B
required int Prop { get; set; }
}
but, don't find it interesting enough to ask you to come back and add the test.
@dotnet/roslyn-compiler for a second pair of eyes on this simple pr :) Thanks! |
Thanks! |
Fixes #75992