pub fn parse_expr(&mut self, precedence: u8) -> Result<ASTNode, ParserError> {
        debug!("parsing expr");
        let mut expr = self.parse_prefix()?;
        debug!("prefix: {:?}", expr);
        loop {
            let next_precedence = self.get_next_precedence()?;
            debug!("next precedence: {:?}", next_precedence);
            if precedence >= next_precedence {
                break;
            }

            if let Some(infix_expr) = self.parse_infix(expr.clone(), next_precedence)? {
                expr = infix_expr;
            }
        }
        Ok(expr)
    }
/// Parse tokens until the precedence changes
Parse tokens until the precedence changes
Parse tokens until the precedence changes
pub fn parse_expr(&mut self, precedence: u8) -> Result<ASTNode, ParserError> {
        debug!("parsing expr");
        let mut expr = self.parse_prefix()?;
        debug!("prefix: {:?}", expr);
        loop {
            let next_precedence = self.get_next_precedence()?;
            debug!("next precedence: {:?}", next_precedence);
            if precedence >= next_precedence {
                break;
            }
            if let Some(infix_expr) = self.parse_infix(expr.clone(), next_precedence)? {
                expr = infix_expr;
            }
        }
        Ok(expr)
    }
pub fn parse_expr ( & mut self , precedence : u8 ) -> Result < ASTNode , ParserError > { debug ! ( " " ) ; let mut expr = self . parse_prefix ( ) ? ; debug ! ( " " expr ) ; loop { let next_precedence = self . get_next_precedence ( ) ? ; debug ! ( " " next_precedence ) ; if precedence >= next_precedence { break ; } if let Some ( infix_expr ) = self . parse_infix ( expr . clone ( ) , next_precedence ) ? { expr = infix_expr ; } } Ok ( expr ) }
Parse tokens until the precedence changes
Parse tokens until the precedence changes
&mut self
precedence
u8
&mut self
precedence
u8