Implement parser using Pratt parsing
This commit is contained in:
1 parent
aad169c24f
commit
a9f737a1ad
3 files changed
+499
No files matched your search
@@ -10,3 +10,14 @@ pub enum Token {
|
||||
Divide,
|
||||
Caret,
|
||||
}
|
||||
|
||||
impl Token {
|
||||
pub fn starts_expression(&self) -> bool {
|
||||
match self {
|
||||
Token::OpenParen => true,
|
||||
Token::Symbol(_) => true,
|
||||
Token::Integer(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user