use super::Position;
use super::Token;

/// A parsed text token and its metadata.
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd)]
pub struct Lexeme {
    token: Token,
    position: Position,
    size: u32,
}

impl Lexeme {
    pub fn new(token: Token, position: Position, size: u32) -> Lexeme {
        Lexeme {
            token,
            position,
            size,
        }
    }

    pub fn token(&self) -> &Token {
        &self.token
    }

    pub fn position(&self) -> Position {
        self.position
    }
}
