refactor(es/parser): Remove :: token as it's not used (#7268)

This commit is contained in:
Cong-Cong Pan 2023-04-15 10:17:37 +08:00 committed by GitHub
parent 0e1435a97f
commit 635bf8116b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 13 deletions

View File

@ -283,12 +283,6 @@ impl<'a> Lexer<'a> {
#[inline(never)]
fn read_token_colon(&mut self) -> LexResult<Token> {
self.input.bump();
if self.syntax.fn_bind() && self.input.cur() == Some(':') {
self.input.bump();
return Ok(tok!("::"));
}
Ok(tok!(':'))
}

View File

@ -73,9 +73,6 @@ macro_rules! tok {
(':') => {
crate::token::Token::Colon
};
("::") => {
crate::token::Token::ColonColon
};
('.') => {
crate::token::Token::Dot
};

View File

@ -64,8 +64,6 @@ pub enum Token {
},
/// ':'
Colon,
/// '::'
ColonColon,
///
BinOp(BinOpToken),
///
@ -132,7 +130,6 @@ impl Token {
| Self::Semi
| Self::Comma
| Self::Colon
| Self::ColonColon
| Self::AssignOp(..)
| Self::DollarLBrace
| Self::QuestionMark
@ -653,7 +650,6 @@ impl Debug for Token {
BackQuote => write!(f, "`")?,
Template { raw, .. } => write!(f, "template token ({})", raw)?,
Colon => write!(f, ":")?,
ColonColon => write!(f, "::")?,
BinOp(op) => write!(f, "{}", BinaryOp::from(*op).as_str())?,
AssignOp(op) => write!(f, "{}", op.as_str())?,
DollarLBrace => write!(f, "${{")?,