forked from M-Labs/nac3
1
0
Fork 0

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
1 changed files with 3 additions and 0 deletions

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 }
}
}