Add PreInc
This commit is contained in:
parent
d45531ce44
commit
bc1e2a2b21
1 changed files with 10 additions and 0 deletions
|
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue