mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 04:58:42 +02:00
Add band
and bor
operator for bit operations (#5936)
* Add `band` and `bor` Operator * Add tests
This commit is contained in:
@ -48,6 +48,9 @@ impl Expression {
|
||||
| Operator::NotEqual
|
||||
| Operator::In
|
||||
| Operator::NotIn => 80,
|
||||
Operator::BitAnd => 75,
|
||||
// Operator::BitXor => 70,
|
||||
Operator::BitOr => 60,
|
||||
Operator::And => 50,
|
||||
Operator::Or => 40,
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ pub enum Operator {
|
||||
Pow,
|
||||
StartsWith,
|
||||
EndsWith,
|
||||
BitOr,
|
||||
BitAnd,
|
||||
ShiftLeft,
|
||||
ShiftRight,
|
||||
}
|
||||
@ -50,6 +52,8 @@ impl Display for Operator {
|
||||
Operator::And => write!(f, "&&"),
|
||||
Operator::Or => write!(f, "||"),
|
||||
Operator::Pow => write!(f, "**"),
|
||||
Operator::BitOr => write!(f, "bor"),
|
||||
Operator::BitAnd => write!(f, "band"),
|
||||
Operator::ShiftLeft => write!(f, "bshl"),
|
||||
Operator::ShiftRight => write!(f, "bshr"),
|
||||
Operator::LessThanOrEqual => write!(f, "<="),
|
||||
|
Reference in New Issue
Block a user