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 fasta scanner error recovery #30276
Comments
Yes, that is expected, but not optimal in this particular example. The difference is in how the old scanner and new scanner recover given unbalanced curly braces, parenthesis, and square brackets. Old scanner: When openers and closers are mismatched, consider the closer to be mismatched. New scanner: When openers and closers are mismatched, consider the opener to be mismatched and insert synthetic closers as needed. In this case, the new scanner is inserting two synthetic |
Interesting, thanks for the info, Dan! I won't presume to know any priority for this, but thanks for triaging! |
Possible improvements:
|
Or
Not sure whether it would fall into this trap or whether it has more context than I'm assuming, but... for (int i = 0; i < count; i++ It would be unfortunate to insert the |
Good points. I like your rewording better than mine, and yes my suggestion would fail given your |
Why was this issue closed? As far as I know the issue has not yet been addressed, and it's an important prerequisite to moving the analyzer onto the front end. If it has been addressed, please document what was done to address the issue. |
It was closed in error because it somehow got moved into the wrong bucket while triaging issues. I apologize. |
At this point, recovery has improved enough that the parser again only reports 3 errors for the example above. Closing this as fixed for now. Feel free to reopen this or perhaps a new issue if there are additional recovery and/or error message improvements to be made. |
We have a smoke test for a tool that uses analysis_server, that sends the following Dart content for analysis:
(Note the syntax errors.) The analysis server used to return 3x errors, but now returns 8. I can't tell if this behavior is better, or expected :) It wasn't announced.
The text was updated successfully, but these errors were encountered: