lex: rm unused hash token

This commit is contained in:
Noah Hellman 2023-01-27 17:15:20 +01:00
parent 5ed30af34d
commit 5827890055

View file

@ -55,7 +55,6 @@ pub enum Symbol {
pub enum Sequence { pub enum Sequence {
Backtick, Backtick,
Dollar, Dollar,
Hash,
Hyphen, Hyphen,
Period, Period,
} }
@ -65,7 +64,6 @@ impl Sequence {
match self { match self {
Self::Backtick => '`', Self::Backtick => '`',
Self::Dollar => '$', Self::Dollar => '$',
Self::Hash => '#',
Self::Period => '.', Self::Period => '.',
Self::Hyphen => '-', Self::Hyphen => '-',
} }
@ -229,7 +227,6 @@ impl<I: Iterator<Item = char> + Clone> Lexer<I> {
'`' => self.eat_seq(Backtick), '`' => self.eat_seq(Backtick),
'$' => self.eat_seq(Dollar), '$' => self.eat_seq(Dollar),
'#' => self.eat_seq(Hash),
'.' => self.eat_seq(Period), '.' => self.eat_seq(Period),
_ => Text, _ => Text,
@ -376,10 +373,9 @@ mod test {
test_lex!("`", Seq(Backtick).l(1)); test_lex!("`", Seq(Backtick).l(1));
test_lex!("```", Seq(Backtick).l(3)); test_lex!("```", Seq(Backtick).l(3));
test_lex!( test_lex!(
"`$#-.", "`$-.",
Seq(Backtick).l(1), Seq(Backtick).l(1),
Seq(Dollar).l(1), Seq(Dollar).l(1),
Seq(Hash).l(1),
Seq(Hyphen).l(1), Seq(Hyphen).l(1),
Seq(Period).l(1), Seq(Period).l(1),
); );