1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum TokenType {
    Unknown,
    Word,
    OpenBrace,
    CloseBrace,
    Eof,
}
impl Default for TokenType {
    fn default() -> Self {
        TokenType::Unknown
    }
}
#[derive(Default, Debug, Copy, Clone)]
pub struct Token<'a> {
    pub typ: TokenType,
    pub word: &'a str,
    pub start: usize,
    pub end: usize,
}