/// Parses a primary expression (an identifier, a number or a parenthesized expression).
Parses a primary expression (an identifier, a number or a parenthesized expression).
Parses a primary expression ( an identifier a number or a parenthesized expression ) .
fn parse_primary(&mut self) -> Result<Expr, &'static str> {
        match self.curr() {
            Ident(_) => self.parse_id_expr(),
            Number(_) => self.parse_nb_expr(),
            LParen => self.parse_paren_expr(),
            If => self.parse_conditional_expr(),
            For => self.parse_for_expr(),
            Var => self.parse_var_expr(),
            _ => Err("Unknown expression."),
        }
    }
fn parse_primary ( & mut self ) -> Result < Expr , & ' static str > { match self . curr ( ) { Ident ( _ ) => self . parse_id_expr ( ) , Number ( _ ) => self . parse_nb_expr ( ) , LParen => self . parse_paren_expr ( ) , If => self . parse_conditional_expr ( ) , For => self . parse_for_expr ( ) , Var => self . parse_var_expr ( ) , _ => Err ( " " ) , } }
Parses a primary expression (an identifier, a number or a parenthesized expression).
Parses a primary expression ( an identifier a number or a parenthesized expression ) .
&mut self