Enum typst_syntax::ast::BinOp
source · pub enum BinOp {
Show 19 variants
Add,
Sub,
Mul,
Div,
And,
Or,
Eq,
Neq,
Lt,
Leq,
Gt,
Geq,
Assign,
In,
NotIn,
AddAssign,
SubAssign,
MulAssign,
DivAssign,
}
Expand description
A binary operator.
Variants§
Add
The addition operator: +
.
Sub
The subtraction operator: -
.
Mul
The multiplication operator: *
.
Div
The division operator: /
.
And
The short-circuiting boolean and
.
Or
The short-circuiting boolean or
.
Eq
The equality operator: ==
.
Neq
The inequality operator: !=
.
Lt
The less-than operator: <
.
Leq
The less-than or equal operator: <=
.
Gt
The greater-than operator: >
.
Geq
The greater-than or equal operator: >=
.
Assign
The assignment operator: =
.
In
The containment operator: in
.
NotIn
The inversed containment operator: not in
.
AddAssign
The add-assign operator: +=
.
SubAssign
The subtract-assign oeprator: -=
.
MulAssign
The multiply-assign operator: *=
.
DivAssign
The divide-assign operator: /=
.
Implementations§
source§impl BinOp
impl BinOp
sourcepub fn from_kind(token: SyntaxKind) -> Option<Self>
pub fn from_kind(token: SyntaxKind) -> Option<Self>
Try to convert the token into a binary operation.
sourcepub fn precedence(self) -> usize
pub fn precedence(self) -> usize
The precedence of this operator.
Trait Implementations§
source§impl PartialEq for BinOp
impl PartialEq for BinOp
impl Copy for BinOp
impl Eq for BinOp
impl StructuralPartialEq for BinOp
Auto Trait Implementations§
impl RefUnwindSafe for BinOp
impl Send for BinOp
impl Sync for BinOp
impl Unpin 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