#[non_exhaustive]pub enum BinOp {
Show 21 variants
And(TokenReference),
Caret(TokenReference),
GreaterThan(TokenReference),
GreaterThanEqual(TokenReference),
LessThan(TokenReference),
LessThanEqual(TokenReference),
Minus(TokenReference),
Or(TokenReference),
Percent(TokenReference),
Plus(TokenReference),
Slash(TokenReference),
Star(TokenReference),
TildeEqual(TokenReference),
TwoDots(TokenReference),
TwoEqual(TokenReference),
Ampersand(TokenReference),
DoubleSlash(TokenReference),
DoubleLessThan(TokenReference),
Pipe(TokenReference),
DoubleGreaterThan(TokenReference),
Tilde(TokenReference),
}
Expand description
Operators that require two operands, such as X + Y or X - Y
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
And(TokenReference)
Caret(TokenReference)
GreaterThan(TokenReference)
GreaterThanEqual(TokenReference)
LessThan(TokenReference)
LessThanEqual(TokenReference)
Minus(TokenReference)
Or(TokenReference)
Percent(TokenReference)
Plus(TokenReference)
Slash(TokenReference)
Star(TokenReference)
TildeEqual(TokenReference)
TwoDots(TokenReference)
TwoEqual(TokenReference)
Ampersand(TokenReference)
Available on crate feature
lua53
only.DoubleSlash(TokenReference)
Available on crate features
roblox
or lua53
only.DoubleLessThan(TokenReference)
Available on crate feature
lua53
only.Pipe(TokenReference)
Available on crate feature
lua53
only.DoubleGreaterThan(TokenReference)
Available on crate feature
lua53
only.Tilde(TokenReference)
Available on crate feature
lua53
only.Implementations§
source§impl BinOp
impl BinOp
sourcepub fn precedence(&self) -> u8
Available on crate feature lua53
only.
pub fn precedence(&self) -> u8
lua53
only.The precedence of the operator, from a scale of 1 to 10. The larger the number, the higher the precedence. See more at https://www.lua.org/manual/5.3/manual.html#2.5.6
sourcepub fn is_right_associative(&self) -> bool
pub fn is_right_associative(&self) -> bool
Whether the operator is right associative. If not, it is left associative. See more at https://www.lua.org/pil/3.5.html
sourcepub fn token(&self) -> &TokenReference
pub fn token(&self) -> &TokenReference
The token associated with the operator
Trait Implementations§
source§impl<'de> Deserialize<'de> for BinOp
impl<'de> Deserialize<'de> for BinOp
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Node for BinOp
impl Node for BinOp
source§fn start_position(&self) -> Option<Position>
fn start_position(&self) -> Option<Position>
The start position of a node. None if can’t be determined
source§fn end_position(&self) -> Option<Position>
fn end_position(&self) -> Option<Position>
The end position of a node. None if it can’t be determined
source§fn similar(&self, other: &Self) -> bool
fn similar(&self, other: &Self) -> bool
Whether another node of the same type is the same as this one semantically, ignoring position
source§impl PartialEq for BinOp
impl PartialEq for BinOp
impl Eq for BinOp
impl StructuralEq 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