-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
"error: expected one of ,
, .
, ?
, or an operator" list is incomplete
#38777
Comments
I'll look into this. |
Also think about this again, if the unexpected symbol is |
I'm not sure how implementing a fixit would work. I can say that counting the number of appropriate )'s is nontrivial due to the recursive nature of the parser, though. But recursively inserting them to terminate sequences (to recover from an error) should be fairly simple. |
Yeah I dont know how the parser works but the logic should be something like "if I found a ; but there aren't enough )'s, offer enough )'s so that they match". If that's not easy then fair enough. |
Well, also, I don't believe that we should accept programs with unclosed parens. I believe the current behavior of printing an error should be correct. |
…estebank Fix Issue 38777 When looking through for a closing bracket in the loop condition, adds them to expecteds. rust-lang#38777
I didn't mean that the parser should actually add them in - it should offer a fixit. Good work on fixing this anyway - a fixit can be added later. |
Take this real code I just wrote:
It gives this error:
Ok so it does give me a note about an unclosed delimiter, but the actual error says
I'm pretty sure
)
isn't an operator, so isn't that list wrong? Shouldn't it sayThe text was updated successfully, but these errors were encountered: