[lexer] Expose token field via method; Clone and Copy Tokens

This commit is contained in:
Eryn Wells 2018-08-19 22:30:19 -07:00
parent 027854d162
commit 281c29ee26

View file

@ -10,7 +10,7 @@ pub struct Lex {
offset: usize,
}
#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Token { LeftParen, RightParen, Id, }
impl Lex {
@ -22,4 +22,6 @@ impl Lex {
offset: offset,
}
}
pub fn token(&self) -> Token { self.token }
}