-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
When tokenising, use semi-colons to hint error recovery #31528
Labels
A-parser
Area: The parsing of Rust source code to an AST
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Comments
What about the semi-colon in array types and repeat expressions? Won't those complicate things? |
We would only do this when we know we are outside |
Mark-Simulacrum
added
the
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
label
Jul 24, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-parser
Area: The parsing of Rust source code to an AST
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
e.g.,
When we hit
}
, we know that the delimiters are mismatched, we currently close all the token trees to recover, but that then gives us a bunch of errors in parsing. We should rewind to the;
and treat that kind of like an EOF, closing the(
and then continuing to tokenise from the;
.Annoyingly we can't do this eagerly since
;
could always be expected. For parens though, this can only happen in macros, so I think for error recovery we can assume the;
terminates a token tree.We could do better by tracking whether we are in macro context during tokenising.
The text was updated successfully, but these errors were encountered: