mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-03 17:10:39 +00:00
internal: remove unused dollars
This commit is contained in:
parent
5a83d1be66
commit
485c5e6717
5 changed files with 5 additions and 53 deletions
|
@ -7,7 +7,7 @@ use drop_bomb::DropBomb;
|
|||
use crate::{
|
||||
event::Event,
|
||||
ParseError,
|
||||
SyntaxKind::{self, EOF, ERROR, L_DOLLAR, R_DOLLAR, TOMBSTONE},
|
||||
SyntaxKind::{self, EOF, ERROR, TOMBSTONE},
|
||||
TokenSet, TokenSource, T,
|
||||
};
|
||||
|
||||
|
@ -215,23 +215,13 @@ impl<'t> Parser<'t> {
|
|||
|
||||
/// Create an error node and consume the next token.
|
||||
pub(crate) fn err_and_bump(&mut self, message: &str) {
|
||||
match self.current() {
|
||||
L_DOLLAR | R_DOLLAR => {
|
||||
let m = self.start();
|
||||
self.error(message);
|
||||
self.bump_any();
|
||||
m.complete(self, ERROR);
|
||||
}
|
||||
_ => {
|
||||
self.err_recover(message, TokenSet::EMPTY);
|
||||
}
|
||||
}
|
||||
self.err_recover(message, TokenSet::EMPTY);
|
||||
}
|
||||
|
||||
/// 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!['}'] | L_DOLLAR | R_DOLLAR => {
|
||||
T!['{'] | T!['}'] => {
|
||||
self.error(message);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue