internal: remove unused dollars

This commit is contained in:
Aleksey Kladov 2021-10-23 20:43:45 +03:00
parent 5a83d1be66
commit 485c5e6717
5 changed files with 5 additions and 53 deletions

View file

@ -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;
}