pub struct ParseState<T, TokErr, Idx, P: Parser<T>> {
parser: P,
end_of_input: Idx,
state: State,
stack: Stack<T, Idx, P>,
queue: ExpressionQueue<T, Idx, P>,
errors: Vec<ParseError<P::Error, TokErr, Idx>>,
}
Fields§
§parser: P
§end_of_input: Idx
§state: State
§stack: Stack<T, Idx, P>
§queue: ExpressionQueue<T, Idx, P>
§errors: Vec<ParseError<P::Error, TokErr, Idx>>
Implementations§
Source§impl<T, TokErr, Idx: Default + Clone, P: Parser<T>> ParseState<T, TokErr, Idx, P>
impl<T, TokErr, Idx: Default + Clone, P: Parser<T>> ParseState<T, TokErr, Idx, P>
pub fn new(parser: P) -> Self
pub fn parse_result(&mut self, result: Result<Token<T, Idx>, TokErr>)
pub fn parse_token(&mut self, token: Token<T, Idx>)
Sourcepub fn has_parsed_expression(&mut self) -> bool
pub fn has_parsed_expression(&mut self) -> bool
Returns whether the parser has parsed a complete expression.
Sourcepub fn has_error(&mut self) -> bool
pub fn has_error(&mut self) -> bool
Returns whether the parser has encountered at least one error
pub fn finish( self, ) -> Result<ExpressionQueue<T, Idx, P>, ParseErrors<P::Error, TokErr, Idx>>
fn parse_term( &mut self, span: Span<Idx>, prefix: Prefix<<P as Parser<T>>::Precedence, <P as Parser<T>>::Delimiter, <P as Parser<T>>::UnaryOperator, <P as Parser<T>>::Term>, ) -> bool
fn parse_operator( &mut self, span: Span<Idx>, postfix: Postfix<<P as Parser<T>>::Precedence, <P as Parser<T>>::Delimiter, <P as Parser<T>>::BinaryOperator, <P as Parser<T>>::UnaryOperator>, ) -> bool
fn process_right_delimiter(&mut self, span: Span<Idx>, right: P::Delimiter)
fn check_delimiter_match( &mut self, left: P::Delimiter, left_span: Span<Idx>, right: P::Delimiter, right_span: Span<Idx>, )
fn process_binary_operator( &mut self, span: Span<Idx>, fixity: Fixity<P::Precedence>, binary: P::BinaryOperator, unary: Option<P::UnaryOperator>, )
fn process_postfix_operator( &mut self, span: Span<Idx>, precedence: P::Precedence, operator: P::UnaryOperator, )
fn pop_while_lower_precedence(&mut self, fixity: &Fixity<P::Precedence>)
Trait Implementations§
Source§impl<T, TokErr, Idx: Default + Clone, P: Parser<T>> Extend<Result<Token<T, Idx>, TokErr>> for ParseState<T, TokErr, Idx, P>
impl<T, TokErr, Idx: Default + Clone, P: Parser<T>> Extend<Result<Token<T, Idx>, TokErr>> for ParseState<T, TokErr, Idx, P>
Source§fn extend<I>(&mut self, iter: I)
fn extend<I>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<T, TokErr, Idx: Default + Clone, P: Parser<T>> Extend<Token<T, Idx>> for ParseState<T, TokErr, Idx, P>
impl<T, TokErr, Idx: Default + Clone, P: Parser<T>> Extend<Token<T, Idx>> for ParseState<T, TokErr, Idx, P>
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Token<T, Idx>>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = Token<T, Idx>>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl<T, TokErr, Idx, P> Freeze for ParseState<T, TokErr, Idx, P>
impl<T, TokErr, Idx, P> RefUnwindSafe for ParseState<T, TokErr, Idx, P>where
P: RefUnwindSafe,
Idx: RefUnwindSafe,
<P as Parser<T>>::BinaryOperator: RefUnwindSafe,
<P as Parser<T>>::UnaryOperator: RefUnwindSafe,
<P as Parser<T>>::Term: RefUnwindSafe,
<P as Parser<T>>::Error: RefUnwindSafe,
TokErr: RefUnwindSafe,
<P as Parser<T>>::Precedence: RefUnwindSafe,
<P as Parser<T>>::Delimiter: RefUnwindSafe,
impl<T, TokErr, Idx, P> Send for ParseState<T, TokErr, Idx, P>
impl<T, TokErr, Idx, P> Sync for ParseState<T, TokErr, Idx, P>
impl<T, TokErr, Idx, P> Unpin for ParseState<T, TokErr, Idx, P>
impl<T, TokErr, Idx, P> UnwindSafe for ParseState<T, TokErr, Idx, P>where
P: UnwindSafe,
Idx: UnwindSafe,
<P as Parser<T>>::BinaryOperator: UnwindSafe,
<P as Parser<T>>::UnaryOperator: UnwindSafe,
<P as Parser<T>>::Term: UnwindSafe,
<P as Parser<T>>::Error: UnwindSafe,
TokErr: UnwindSafe,
<P as Parser<T>>::Precedence: UnwindSafe,
<P as Parser<T>>::Delimiter: 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