We have blocks & scopes

This commit is contained in:
2026-07-08 05:22:32 -05:00
parent 4aa9341bf3
commit 3c7cd3c4c7
5 changed files with 88 additions and 15 deletions
+4
View File
@@ -4,6 +4,8 @@ use super::Token;
pub enum Symbol {
EqualSign,
Semicolon,
OpenBrace,
CloseBrace,
}
pub fn parse_symbol(input: &str) -> Option<(Token, &str)> {
@@ -12,6 +14,8 @@ pub fn parse_symbol(input: &str) -> Option<(Token, &str)> {
match c {
'=' => Some((Token::Sym(Symbol::EqualSign), input)),
';' => Some((Token::Sym(Symbol::Semicolon), input)),
'{' => Some((Token::Sym(Symbol::OpenBrace), input)),
'}' => Some((Token::Sym(Symbol::CloseBrace), input)),
_ => None
}
}