Skip to content

Commit 0f72134

Browse files
committed
Improve precedence variant name of sum and product operators
1 parent 06f34fc commit 0f72134

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/precedence.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ pub(crate) enum Precedence {
2828
// << >>
2929
Shift,
3030
// + -
31-
Arithmetic,
31+
Sum,
3232
// * / %
33-
Term,
33+
Product,
3434
// as
3535
Cast,
3636
// unary - * ! & &mut
@@ -44,8 +44,8 @@ pub(crate) enum Precedence {
4444
impl Precedence {
4545
pub(crate) fn of_binop(op: &BinOp) -> Self {
4646
match op {
47-
BinOp::Add(_) | BinOp::Sub(_) => Precedence::Arithmetic,
48-
BinOp::Mul(_) | BinOp::Div(_) | BinOp::Rem(_) => Precedence::Term,
47+
BinOp::Add(_) | BinOp::Sub(_) => Precedence::Sum,
48+
BinOp::Mul(_) | BinOp::Div(_) | BinOp::Rem(_) => Precedence::Product,
4949
BinOp::And(_) => Precedence::And,
5050
BinOp::Or(_) => Precedence::Or,
5151
BinOp::BitXor(_) => Precedence::BitXor,

0 commit comments

Comments
 (0)