Struct peresil::ParseMaster
[−]
[src]
pub struct ParseMaster<P, E> { /* fields omitted */ }
The main entrypoint to parsing.
This tracks the collection of outstanding errors and provides helper methods for parsing alternative paths and sequences of other parsers.
Methods
impl<'a, P, E> ParseMaster<P, E> where
P: Point,
E: Recoverable,
[src]
P: Point,
E: Recoverable,
fn new() -> ParseMaster<P, E>
fn optional<T, F>(&mut self, point: P, parser: F) -> Progress<P, Option<T>, E> where
F: FnMut(&mut ParseMaster<P, E>, P) -> Progress<P, T, E>,
F: FnMut(&mut ParseMaster<P, E>, P) -> Progress<P, T, E>,
Returns the value on success, or rewinds the point and returns
None
on a recoverable failure. Non-recoverable failures are
propagated.
fn alternate<'pm, T>(&'pm mut self) -> Alternate<'pm, P, T, E>
Run sub-parsers in order until one succeeds.
fn zero_or_more<F, T>(&mut self, point: P, parser: F) -> Progress<P, Vec<T>, E> where
F: FnMut(&mut ParseMaster<P, E>, P) -> Progress<P, T, E>,
F: FnMut(&mut ParseMaster<P, E>, P) -> Progress<P, T, E>,
Runs the parser until it fails.
If the parser fails due to a recoverable error, a collection of values will be returned and the point will be at the end of the last successful parse. If the error is not recoverable, the error will be passed through directly.
fn finish<T>(&mut self, progress: Progress<P, T, E>) -> Progress<P, T, Vec<E>>
When parsing is complete, provide the final result and gain access to all failures. Will be recycled and may be used for further parsing.
Trait Implementations
impl<P: Debug, E: Debug> Debug for ParseMaster<P, E>
[src]
impl<P: PartialEq, E: PartialEq> PartialEq for ParseMaster<P, E>
[src]
fn eq(&self, __arg_0: &ParseMaster<P, E>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ParseMaster<P, E>) -> bool
This method tests for !=
.