Enum passerine::compiler::parse::Prec [−][src]
#[repr(u8)]
pub enum Prec {
None,
Assign,
Pair,
Lambda,
Logic,
AddSub,
MulDiv,
Pow,
Compose,
Call,
End,
}
Expand description
We’re using a Pratt parser, so this little enum
defines different precedence levels.
Each successive level is higher, so, for example,
* > +
.
Variants
Implementations
Increments precedence level to cause the parser to associate infix operators to the left. For example, addition is left-associated:
Prec::Addition.associate_left()
a + b + c
left-associated becomes (a + b) + c
.
By default, the parser accociates right.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Prec
impl UnwindSafe for Prec
Blanket Implementations
Mutably borrows from an owned value. Read more