a ton of stuff idk more ir work

This commit is contained in:
2024-10-22 02:30:50 -04:00
parent 14a4fb1ff9
commit 87f755b763
46 changed files with 1967 additions and 540 deletions

View File

@@ -4,15 +4,25 @@ pub enum Keyword {
Let,
If,
Return,
Struct,
Trait,
Impl,
For,
Asm,
}
impl Keyword {
pub fn from_string(str: &str) -> Option<Self> {
Some(match str {
"fn" => Self::Fn,
"struct" => Self::Struct,
"let" => Self::Let,
"if" => Self::If,
"for" => Self::For,
"return" => Self::Return,
"trait" => Self::Trait,
"impl" => Self::Impl,
"asm" => Self::Asm,
_ => return None,
})
}