-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Improve parser error recovery around misplaced semicolon #65089
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 parser error recovery around misplaced semicolon #65089
Conversation
c229830 to
625b16a
Compare
625b16a to
ab825ed
Compare
|
@dotnet/roslyn-compiler could i get eyes on this? |
333fred
left a comment
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.
Done review pass (commit 3)
| result = null; | ||
| return false; | ||
|
|
||
| bool isStartOfPropertyBody(SyntaxKind kind) |
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.
Consider extracting this and using below as well.
|
|
||
| switch (this.CurrentToken.Kind) | ||
| // `{` or `=>` definitely start a property. Also allow | ||
| // `; {` and `; =>` as error recovery fo ra misplaced semicolon. |
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.
| N(SyntaxKind.EndOfFileToken); | ||
| } | ||
| EOF(); | ||
| } |
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.
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.
we are, yes. and they def discovered interesting stuff for example, that int MyProperty; { is totally legal at the script/top-level as a local/field, followed by a block :)
Fixes #52