[lexer] Expose token field via method; Clone and Copy Tokens
This commit is contained in:
parent
027854d162
commit
281c29ee26
1 changed files with 3 additions and 1 deletions
|
@ -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 }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue