Somewhat working binary expressions

This commit is contained in:
2025-11-24 22:03:50 -07:00
parent c019b093d2
commit ae8199fa8c
4 changed files with 372 additions and 75 deletions

View File

@@ -259,6 +259,11 @@ impl Parser {
}
// A priority expression ( -> (1 + 2) <- + 3 )
TokenType::Symbol(Symbol::LParen) => self.priority().map(Expression::Priority),
TokenType::Symbol(Symbol::Minus) => {
self.assign_next()?;
let inner = self.get_binary_child_node()?;
Ok(Expression::Negation(boxed!(inner)))
}
// A function invocation
TokenType::Identifier(_)
if self_matches_peek!(self, TokenType::Symbol(Symbol::LParen)) =>