pub enum BinOp {
Show 16 variants
Add,
Sub,
Mul,
Div,
Mod,
Concat,
Eq,
Ne,
Lt,
Le,
Gt,
Ge,
IsDistinctFrom,
IsNotDistinctFrom,
And,
Or,
}Expand description
Syntactic binary operators. Parsed precedence determines grouping;
this enum only identifies the operator itself. Comparison and logical
operators live alongside arithmetic so a single Expr::BinaryOp
walker can cover every infix form the parser emits.
Variants§
Implementations§
Source§impl BinOp
impl BinOp
pub fn is_distinctness_comparison(self) -> bool
Sourcepub fn precedence(self) -> u8
pub fn precedence(self) -> u8
Left-binding precedence for Pratt parsing. Higher = binds tighter. Mirrors PG gram.y’s precedence table for the operators we have.
Trait Implementations§
impl Copy for BinOp
impl Eq for BinOp
impl StructuralPartialEq for BinOp
Auto Trait Implementations§
impl Forget for BinOp
impl Freeze for BinOp
impl Move for BinOp
impl RefUnwindSafe for BinOp
impl Send for BinOp
impl Sync for BinOp
impl Unpin for BinOp
impl UnsafeUnpin for BinOp
impl UnwindSafe for BinOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more