1
0
forked from M-Labs/nac3

nac3parser: modify to handle UAdd in front of int constant

This commit is contained in:
ychenfo 2022-03-08 03:02:40 +08:00 committed by Gitea
parent 60b3807ab3
commit e266d3c2b0

View File

@ -923,6 +923,9 @@ Factor: ast::Expr = {
kind: kind.clone()
}
}
(ast::Unaryop::UAdd, ast::ExprKind::Constant { value: Constant::Int(val), kind }) => {
ast::ExprKind::Constant { value: Constant::Int(*val), kind: kind.clone() }
}
_ => ast::ExprKind::UnaryOp { operand: Box::new(e), op }
}
}