From bc1e2a2b2194c4ce4b302800713b7d8ac5d64624 Mon Sep 17 00:00:00 2001 From: flameyosflow Date: Tue, 16 Dec 2025 12:11:51 +0200 Subject: [PATCH] Add PreInc --- src/parser.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/parser.rs b/src/parser.rs index b5c67e4..5108bbc 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1273,6 +1273,16 @@ impl Parser { attributes: Vec::new(), }) } + Some(Token::PlusPlus) => { + self.next(); + let expr = self.parse_unary_expr()?; + let end = expr.span.end; + Ok(Expr { + kind: ExprKind::UnOp(UnOp::PreInc, Box::new(expr)), + span: Span::new(&(start..end), self.file.clone()), + attributes: Vec::new(), + }) + } _ => self.parse_postfix_expr(), } }