struct Stack<T, Idx, P: Parser<T>> {
stack: Vec<StackElement<T, Idx, P>>,
first_delimiter_idx: Option<usize>,
}
Fields§
§stack: Vec<StackElement<T, Idx, P>>
§first_delimiter_idx: Option<usize>
Implementations§
Source§impl<T, Idx, P: Parser<T>> Stack<T, Idx, P>
impl<T, Idx, P: Parser<T>> Stack<T, Idx, P>
fn new() -> Self
fn push(&mut self, element: StackElement<T, Idx, P>)
fn pop(&mut self) -> Option<StackElement<T, Idx, P>>
fn peek_top(&self) -> Option<&StackElement<T, Idx, P>>
fn has_delimiter(&self) -> bool
Sourcefn pop_if_lower_precedence(
&mut self,
fixity: &Fixity<P::Precedence>,
) -> Option<StackElement<T, Idx, P>>
fn pop_if_lower_precedence( &mut self, fixity: &Fixity<P::Precedence>, ) -> Option<StackElement<T, Idx, P>>
Pops the stack if the new operator has lower precedence than the top of the stack
fn precedence(&self) -> Option<&P::Precedence>
Trait Implementations§
Auto Trait Implementations§
impl<T, Idx, P> Freeze for Stack<T, Idx, P>
impl<T, Idx, P> RefUnwindSafe for Stack<T, Idx, P>where
Idx: RefUnwindSafe,
<P as Parser<T>>::Precedence: RefUnwindSafe,
<P as Parser<T>>::Delimiter: RefUnwindSafe,
<P as Parser<T>>::BinaryOperator: RefUnwindSafe,
<P as Parser<T>>::UnaryOperator: RefUnwindSafe,
<P as Parser<T>>::Term: RefUnwindSafe,
impl<T, Idx, P> Send for Stack<T, Idx, P>
impl<T, Idx, P> Sync for Stack<T, Idx, P>
impl<T, Idx, P> Unpin for Stack<T, Idx, P>
impl<T, Idx, P> UnwindSafe for Stack<T, Idx, P>where
Idx: UnwindSafe,
<P as Parser<T>>::Precedence: UnwindSafe,
<P as Parser<T>>::Delimiter: UnwindSafe,
<P as Parser<T>>::BinaryOperator: UnwindSafe,
<P as Parser<T>>::UnaryOperator: UnwindSafe,
<P as Parser<T>>::Term: UnwindSafe,
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