lex: rm unused colon token

This commit is contained in:
Noah Hellman 2023-01-27 17:14:30 +01:00
parent c23dbf8e34
commit 5ed30af34d

View file

@ -54,7 +54,6 @@ pub enum Symbol {
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Sequence { pub enum Sequence {
Backtick, Backtick,
Colon,
Dollar, Dollar,
Hash, Hash,
Hyphen, Hyphen,
@ -65,7 +64,6 @@ impl Sequence {
fn ch(self) -> char { fn ch(self) -> char {
match self { match self {
Self::Backtick => '`', Self::Backtick => '`',
Self::Colon => ':',
Self::Dollar => '$', Self::Dollar => '$',
Self::Hash => '#', Self::Hash => '#',
Self::Period => '.', Self::Period => '.',
@ -230,7 +228,6 @@ impl<I: Iterator<Item = char> + Clone> Lexer<I> {
'"' => Sym(Quote2), '"' => Sym(Quote2),
'`' => self.eat_seq(Backtick), '`' => self.eat_seq(Backtick),
':' => self.eat_seq(Colon),
'$' => self.eat_seq(Dollar), '$' => self.eat_seq(Dollar),
'#' => self.eat_seq(Hash), '#' => self.eat_seq(Hash),
'.' => self.eat_seq(Period), '.' => self.eat_seq(Period),
@ -379,9 +376,8 @@ 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(Colon).l(1),
Seq(Dollar).l(1), Seq(Dollar).l(1),
Seq(Hash).l(1), Seq(Hash).l(1),
Seq(Hyphen).l(1), Seq(Hyphen).l(1),