mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Improve readability of the parser code
This commit is contained in:
parent
00a0125372
commit
2a41b2cd94
10 changed files with 38 additions and 63 deletions
|
@ -250,12 +250,9 @@ impl<'t> Parser<'t> {
|
|||
|
||||
/// Create an error node and consume the next token.
|
||||
pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) {
|
||||
match self.current() {
|
||||
T!['{'] | T!['}'] => {
|
||||
self.error(message);
|
||||
return;
|
||||
}
|
||||
_ => (),
|
||||
if matches!(self.current(), T!['{'] | T!['}']) {
|
||||
self.error(message);
|
||||
return;
|
||||
}
|
||||
|
||||
if self.at_ts(recovery) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue