token: Add Display impl for Type

This improves readability in identify_tokens
This commit is contained in:
2023-09-28 01:34:56 -05:00
parent 48f5e5248c
commit 545483dae6
3 changed files with 73 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let line = line?;
let mut lexer = Lexer::new(&line);
while let Some(token) = lexer.any() {
println!("{:?}: {}", token, &line[token.range()])
println!("{:#19} {}", token.ty(), &line[token.range()])
}
}
Ok(())