Enum yash_syntax::parser::lex::Operator
source · pub enum Operator {
Show 22 variants
Newline,
And,
AndAnd,
OpenParen,
CloseParen,
Semicolon,
SemicolonSemicolon,
Less,
LessAnd,
LessOpenParen,
LessLess,
LessLessDash,
LessLessLess,
LessGreater,
Greater,
GreaterAnd,
GreaterOpenParen,
GreaterGreater,
GreaterGreaterBar,
GreaterBar,
Bar,
BarBar,
}
Expand description
Operator token identifier.
Variants§
Newline
Newline
And
&
AndAnd
&&
OpenParen
(
CloseParen
)
Semicolon
;
SemicolonSemicolon
;;
Less
<
LessAnd
<&
LessOpenParen
<(
LessLess
<<
LessLessDash
<<-
LessLessLess
<<<
LessGreater
<>
Greater
>
GreaterAnd
>&
GreaterOpenParen
>(
GreaterGreater
>>
GreaterGreaterBar
>>|
GreaterBar
>|
Bar
|
BarBar
||
Implementations§
source§impl Operator
impl Operator
sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Returns the literal string representation of the operator.
sourcepub const fn is_clause_delimiter(self) -> bool
pub const fn is_clause_delimiter(self) -> bool
Determines if this token can be a delimiter of a clause.
This function returns true
for CloseParen
and SemicolonSemicolon
,
and false
for others.
Trait Implementations§
source§impl PartialEq for Operator
impl PartialEq for Operator
source§impl TryFrom<Operator> for AndOr
impl TryFrom<Operator> for AndOr
§type Error = TryFromOperatorError
type Error = TryFromOperatorError
The type returned in the event of a conversion error.
source§impl TryFrom<Operator> for RedirOp
impl TryFrom<Operator> for RedirOp
§type Error = TryFromOperatorError
type Error = TryFromOperatorError
The type returned in the event of a conversion error.
impl Copy for Operator
impl Eq for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl Freeze for Operator
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnwindSafe for Operator
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more