diff --git a/src/ast/mod.rs b/src/ast/mod.rs index bb57460..0c43e0c 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -248,6 +248,10 @@ impl Parser { fn parse_primary_expr(&mut self) -> Result { let token = self.lexer.require_next()?; match token.kind { + token::Kind::OParen => { + let expr = self.parse_binary_expr_or_higher(&[token::Kind::CParen])?; + self.parse_primary_expr_rest(expr) + }, token::Kind::Ident => { let ident = tree::Node::Ident(String::from(token.raw)); self.parse_primary_expr_rest(ident)