Last active
December 5, 2022 02:11
-
-
Save coffeebe4code/494ece0b94b651c3a456559b09e2b028 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn high_bin(&mut self) -> Option<Box<Expr<'a>>> { | |
let left = self.term()?; | |
let bin = self | |
.lexer | |
.collect_of_if(&[Token::Div, Token::Mul, Token::Mod]); | |
if let Some(x) = bin { | |
// TODO:: Error if expr is none | |
let right = self.term()?; | |
return some_expr!(BinOp, left, x.token, right); | |
} | |
return Some(left); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment