mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Introduce separate hir::BinaryOp
Unlike ast::BinOp, it has significantly more structure to it, so it's easier to, say, handle all assignment-like operations in the same way.
This commit is contained in:
parent
8919aa8065
commit
7e5a186c1f
4 changed files with 96 additions and 75 deletions
|
@ -102,10 +102,6 @@ pub enum BinOp {
|
|||
BitwiseOr,
|
||||
/// The `&` operator for bitwise AND
|
||||
BitwiseAnd,
|
||||
/// The `..` operator for right-open ranges
|
||||
RangeRightOpen,
|
||||
/// The `..=` operator for right-closed ranges
|
||||
RangeRightClosed,
|
||||
/// The `=` operator for assignment
|
||||
Assignment,
|
||||
/// The `+=` operator for assignment after addition
|
||||
|
@ -152,8 +148,6 @@ impl ast::BinExpr {
|
|||
T![^] => BinOp::BitwiseXor,
|
||||
T![|] => BinOp::BitwiseOr,
|
||||
T![&] => BinOp::BitwiseAnd,
|
||||
T![..] => BinOp::RangeRightOpen,
|
||||
T![..=] => BinOp::RangeRightClosed,
|
||||
T![=] => BinOp::Assignment,
|
||||
T![+=] => BinOp::AddAssign,
|
||||
T![/=] => BinOp::DivAssign,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue