WIP -- emit compilation errors

This commit is contained in:
2025-12-01 02:54:53 -07:00
parent 06a151ab7e
commit 25d9222bd4
8 changed files with 395 additions and 178 deletions

View File

@@ -87,6 +87,21 @@ pub enum TokenType {
EOF,
}
impl From<TokenType> for u32 {
fn from(value: TokenType) -> Self {
use TokenType::*;
match value {
String(_) => 1,
Number(_) => 2,
Boolean(_) => 3,
Keyword(_) => 4,
Identifier(_) => 5,
Symbol(_) => 6,
EOF => 0,
}
}
}
impl std::fmt::Display for TokenType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {