[−][src]Trait gobble::ptrait::Parser
The core trait for parsing
Associated Types
type Out
Required methods
Loading content...Provided methods
fn expected(&self) -> Expected
fn parse_s(&self, s: &str) -> Result<Self::Out, ParseError>
fn parse_sn<'a>(&self, s: &'a str) -> Result<(&'a str, Self::Out), ParseError>
fn then<P: Parser<Out = V2>, V2>(self, b: P) -> Then<Self, P>
returns a parser that will combine the results of this and the given parser into a tuple
fn then_ig<P: Parser<Out = V2>, V2>(self, b: P) -> ThenIg<Self, P>
returns a Parser that will require the given parser completes, but ignores its result useful for dropping brackets and whitespace
fn ig_then<P: Parser<Out = V2>, V2>(self, b: P) -> IgThen<Self, P>
returns a Parser that will require this parser completes, but only return the result of the given parser useful for dropping brackets and whitespace etc
fn or<P: Parser<Out = Self::Out>>(self, p: P) -> Or<Self, P>
Returns a Parser that will try both child parsers, (A first) and return the first successfl result
fn map<F: Fn(Self::Out) -> V2, V2>(self, f: F) -> Map<Self, V2, F>
Returns a Parser that converts the result of a successful parse to a different type. Much like map on iterators and Result
fn try_map<F: Fn(Self::Out) -> Result<V2, Expected>, V2>(
self,
f: F
) -> TryMap<Self, V2, F>
self,
f: F
) -> TryMap<Self, V2, F>
Returns a Parser that converts the result of a successful parse to a different type. however the map function can fail and return a result The Error type should be err::ECode, this does not have line associated. That will be attacked by the TryMap object so this will pass that error up correctly
fn asv<R: Clone>(self, r: R) -> As<Self, R>
fn ig(self) -> As<Self, ()>
fn map_exp<F: Fn(Expected) -> Expected>(self, f: F) -> MapExp<Self, F>
fn brk(self) -> Break<Self>
Implementations on Foreign Types
impl Parser for &'static str
[src]
type Out = &'static str
fn parse<'a>(&self, i: &LCChars<'a>) -> ParseRes<'a, &'static str>
[src]
fn expected(&self) -> Expected
[src]
impl Parser for char
[src]
type Out = char
fn parse<'a>(&self, i: &LCChars<'a>) -> ParseRes<'a, char>
[src]
fn expected(&self) -> Expected
[src]
impl<A, B> Parser for (A, B) where
A: Parser,
B: Parser,
[src]
A: Parser,
B: Parser,
type Out = (A::Out, B::Out)
fn parse<'a>(&self, it: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
fn expected(&self) -> Expected
[src]
impl<A, B, C> Parser for (A, B, C) where
A: Parser,
B: Parser,
C: Parser,
[src]
A: Parser,
B: Parser,
C: Parser,
type Out = (A::Out, B::Out, C::Out)
fn parse<'a>(&self, it: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
fn expected(&self) -> Expected
[src]
impl<A, B, C, D> Parser for (A, B, C, D) where
A: Parser,
B: Parser,
C: Parser,
D: Parser,
[src]
A: Parser,
B: Parser,
C: Parser,
D: Parser,
type Out = (A::Out, B::Out, C::Out, D::Out)
fn parse<'a>(&self, it: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
fn expected(&self) -> Expected
[src]
impl<A, B, C, D, E> Parser for (A, B, C, D, E) where
A: Parser,
B: Parser,
C: Parser,
D: Parser,
E: Parser,
[src]
A: Parser,
B: Parser,
C: Parser,
D: Parser,
E: Parser,
type Out = (A::Out, B::Out, C::Out, D::Out, E::Out)
fn parse<'a>(&self, it: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
fn expected(&self) -> Expected
[src]
impl<A, B, C, D, E, F> Parser for (A, B, C, D, E, F) where
A: Parser,
B: Parser,
C: Parser,
D: Parser,
E: Parser,
F: Parser,
[src]
A: Parser,
B: Parser,
C: Parser,
D: Parser,
E: Parser,
F: Parser,
type Out = (A::Out, B::Out, C::Out, D::Out, E::Out, F::Out)
fn parse<'a>(&self, it: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
fn expected(&self) -> Expected
[src]
Implementors
impl<A> Parser for Maybe<A> where
A: Parser,
[src]
A: Parser,
impl<A, B> Parser for Wrap<A, B> where
A: Parser,
B: Parser,
[src]
A: Parser,
B: Parser,
impl<A, B> Parser for IgThen<A, B> where
A: Parser,
B: Parser,
[src]
A: Parser,
B: Parser,
type Out = B::Out
fn parse<'a>(&self, i: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
fn expected(&self) -> Expected
[src]
impl<A, B> Parser for Then<A, B> where
A: Parser,
B: Parser,
[src]
A: Parser,
B: Parser,
type Out = (A::Out, B::Out)
fn parse<'a>(&self, i: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
fn expected(&self) -> Expected
[src]
impl<A, B> Parser for ThenIg<A, B> where
A: Parser,
B: Parser,
[src]
A: Parser,
B: Parser,
type Out = A::Out
fn parse<'a>(&self, i: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
fn expected(&self) -> Expected
[src]
impl<A, B> Parser for SepPlus<A, B> where
A: Parser,
B: Parser,
[src]
A: Parser,
B: Parser,
impl<A, B> Parser for SepStar<A, B> where
A: Parser,
B: Parser,
[src]
A: Parser,
B: Parser,
impl<A, B> Parser for String2P<A, B> where
A: Parser,
B: Parser,
A::Out: Into<String>,
B::Out: AsRef<str>,
[src]
A: Parser,
B: Parser,
A::Out: Into<String>,
B::Out: AsRef<str>,
impl<A, B, C> Parser for Reflect<A, B, C> where
A: Parser,
B: Parser,
C: Parser,
[src]
A: Parser,
B: Parser,
C: Parser,
type Out = (Vec<A::Out>, B::Out, Vec<C::Out>)
fn parse<'a>(&self, it: &LCChars<'a>) -> ParseRes<'a, Self::Out>
[src]
impl<A, B, C> Parser for SepUntil<A, B, C> where
A: Parser,
B: Parser,
C: Parser,
[src]
A: Parser,
B: Parser,
C: Parser,
impl<A, B, V> Parser for Or<A, B> where
A: Parser<Out = V>,
B: Parser<Out = V>,
[src]
A: Parser<Out = V>,
B: Parser<Out = V>,