Lexer impl done

This commit is contained in:
2025-12-08 23:19:23 -07:00
parent 115a57128c
commit fac36c756b
3 changed files with 44 additions and 49 deletions

View File

@@ -84,6 +84,12 @@ pub struct Token<'a> {
pub span: Span,
}
impl<'a> std::fmt::Display for Token<'a> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.token_type)
}
}
impl<'a> Token<'a> {
pub fn new(token_type: TokenType<'a>, line: usize, span: Span) -> Self {
Self {