Binary expressions are working with PEMDAS

This commit is contained in:
2024-11-22 01:57:50 -07:00
parent bf13987449
commit 5ec0a79e6c
4 changed files with 244 additions and 71 deletions

View File

@@ -106,6 +106,8 @@ pub enum Symbol {
LogicalNot,
/// Represents the `.` symbol
Dot,
/// Represents the `^` symbol
Caret,
// Double Character Symbols
/// Represents the `==` symbol
@@ -125,7 +127,7 @@ pub enum Symbol {
impl Symbol {
pub fn is_operator(&self) -> bool {
match self {
Symbol::Plus | Symbol::Minus | Symbol::Asterisk | Symbol::Slash => true,
Symbol::Plus | Symbol::Minus | Symbol::Asterisk | Symbol::Slash | Symbol::Caret => true,
_ => false,
}
}