pub struct Collect<P, Container, Ctx, Lang: ?Sized = ()> { /* private fields */ }Expand description
A parser that collects results into a container.
Implementations§
Source§impl<P, Container, Ctx, Lang: ?Sized> Collect<P, Container, Ctx, Lang>
impl<P, Container, Ctx, Lang: ?Sized> Collect<P, Container, Ctx, Lang>
Sourcepub const fn as_mut(&mut self) -> Collect<&mut P, &mut Container, Ctx, Lang>
pub const fn as_mut(&mut self) -> Collect<&mut P, &mut Container, Ctx, Lang>
Creates a mutable reference version of this Collect combinator.
Sourcepub fn map_parser<F, P2>(self, f: F) -> Collect<P2, Container, Ctx, Lang>where
F: FnOnce(P) -> P2,
pub fn map_parser<F, P2>(self, f: F) -> Collect<P2, Container, Ctx, Lang>where
F: FnOnce(P) -> P2,
Maps the inner parser to a new parser.
Sourcepub fn map_container<F, C2>(self, f: F) -> Collect<P, C2, Ctx, Lang>where
F: FnOnce(Container) -> C2,
pub fn map_container<F, C2>(self, f: F) -> Collect<P, C2, Ctx, Lang>where
F: FnOnce(Container) -> C2,
Maps the inner container to a new container.
Trait Implementations§
Source§impl<P: Clone, Container: Clone, Ctx: Clone, Lang: Clone + ?Sized> Clone for Collect<P, Container, Ctx, Lang>
impl<P: Clone, Container: Clone, Ctx: Clone, Lang: Clone + ?Sized> Clone for Collect<P, Container, Ctx, Lang>
Source§impl<P: Debug, Container: Debug, Ctx: Debug, Lang: Debug + ?Sized> Debug for Collect<P, Container, Ctx, Lang>
impl<P: Debug, Container: Debug, Ctx: Debug, Lang: Debug + ?Sized> Debug for Collect<P, Container, Ctx, Lang>
Source§impl<P: Hash, Container: Hash, Ctx: Hash, Lang: Hash + ?Sized> Hash for Collect<P, Container, Ctx, Lang>
impl<P: Hash, Container: Hash, Ctx: Hash, Lang: Hash + ?Sized> Hash for Collect<P, Container, Ctx, Lang>
Source§impl<'inp, 'c, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<&'c mut Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, &'c mut Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: Container<O>,
Max: MaxSpec,
Min: MinSpec,
impl<'inp, 'c, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<&'c mut Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, &'c mut Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: Container<O>,
Max: MaxSpec,
Min: MinSpec,
Source§fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Try to parse from the given input.
Source§fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
Wraps the output of this parser in a
Spanned with the span of the parsed input.Source§fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
Wraps the output of this parser in a
Sliced with the source slice of the parsed input.Source§fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
Wraps the output of this parser in a
Located with the span and source slice of the parsed input.Source§fn repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
Creates a
Repeated combinator that applies this parser repeatedly
until the condition handler Condition returns [RepeatedAction::End] or an fatal error.Source§fn separated_by<SepClassifier, Condition, W>(
self,
sep_classifier: SepClassifier,
condition: Condition,
) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
Filter the output of this parser using a validation function. Read more
Source§fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
Filter and map the output of this parser using a validation/transformation function. Read more
Source§fn validate<F>(self, validator: F) -> Validate<Self, F>
fn validate<F>(self, validator: F) -> Validate<Self, F>
Validate the output of this parser with full location context. Read more
Source§fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
Sequence this parser with another, using the first result to determine the second parser.
Source§fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
Sequence this parser with another, ignoring the output of the first.
Source§fn recover<R>(self, recovery: R) -> Recover<Self, R>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
Source§impl<'inp, 'c, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<&'c mut SeparatedBy<&'c mut F, &'c mut SepClassifier, Condition, O, W, L, Ctx, &'c mut SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, &'c mut Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
SepClassifier: Check<L::Token>,
Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: SeparatorsContainer<Spanned<L::Token, L::Span>, O>,
W: Window,
Trailing: TrailingSpec,
Leading: LeadingSpec,
Max: MaxSpec,
Min: MinSpec,
impl<'inp, 'c, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<&'c mut SeparatedBy<&'c mut F, &'c mut SepClassifier, Condition, O, W, L, Ctx, &'c mut SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, &'c mut Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
SepClassifier: Check<L::Token>,
Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: SeparatorsContainer<Spanned<L::Token, L::Span>, O>,
W: Window,
Trailing: TrailingSpec,
Leading: LeadingSpec,
Max: MaxSpec,
Min: MinSpec,
Source§fn parse_input(
&mut self,
input: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
fn parse_input(
&mut self,
input: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Try to parse from the given input.
Source§fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
Wraps the output of this parser in a
Spanned with the span of the parsed input.Source§fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
Wraps the output of this parser in a
Sliced with the source slice of the parsed input.Source§fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
Wraps the output of this parser in a
Located with the span and source slice of the parsed input.Source§fn repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
Creates a
Repeated combinator that applies this parser repeatedly
until the condition handler Condition returns [RepeatedAction::End] or an fatal error.Source§fn separated_by<SepClassifier, Condition, W>(
self,
sep_classifier: SepClassifier,
condition: Condition,
) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
Filter the output of this parser using a validation function. Read more
Source§fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
Filter and map the output of this parser using a validation/transformation function. Read more
Source§fn validate<F>(self, validator: F) -> Validate<Self, F>
fn validate<F>(self, validator: F) -> Validate<Self, F>
Validate the output of this parser with full location context. Read more
Source§fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
Sequence this parser with another, using the first result to determine the second parser.
Source§fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
Sequence this parser with another, ignoring the output of the first.
Source§fn recover<R>(self, recovery: R) -> Recover<Self, R>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
Source§impl<'inp, 'c, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<SeparatedBy<&'c mut F, &'c mut SepClassifier, &'c mut Condition, O, W, L, Ctx, &'c mut SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, &'c mut Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
SepClassifier: Check<L::Token>,
Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: SeparatorsContainer<Spanned<L::Token, L::Span>, O>,
W: Window,
Trailing: TrailingSpec,
Leading: LeadingSpec,
Max: MaxSpec,
Min: MinSpec,
impl<'inp, 'c, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<SeparatedBy<&'c mut F, &'c mut SepClassifier, &'c mut Condition, O, W, L, Ctx, &'c mut SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, &'c mut Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
SepClassifier: Check<L::Token>,
Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: SeparatorsContainer<Spanned<L::Token, L::Span>, O>,
W: Window,
Trailing: TrailingSpec,
Leading: LeadingSpec,
Max: MaxSpec,
Min: MinSpec,
Source§fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
Try to parse from the given input.
Source§fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
Wraps the output of this parser in a
Spanned with the span of the parsed input.Source§fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
Wraps the output of this parser in a
Sliced with the source slice of the parsed input.Source§fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
Wraps the output of this parser in a
Located with the span and source slice of the parsed input.Source§fn repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
Creates a
Repeated combinator that applies this parser repeatedly
until the condition handler Condition returns [RepeatedAction::End] or an fatal error.Source§fn separated_by<SepClassifier, Condition, W>(
self,
sep_classifier: SepClassifier,
condition: Condition,
) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
Filter the output of this parser using a validation function. Read more
Source§fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
Filter and map the output of this parser using a validation/transformation function. Read more
Source§fn validate<F>(self, validator: F) -> Validate<Self, F>
fn validate<F>(self, validator: F) -> Validate<Self, F>
Validate the output of this parser with full location context. Read more
Source§fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
Sequence this parser with another, using the first result to determine the second parser.
Source§fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
Sequence this parser with another, ignoring the output of the first.
Source§fn recover<R>(self, recovery: R) -> Recover<Self, R>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
Source§impl<'inp, L, P, Open, Close, O, Condition, Container, Ctx, Delim, W, Max, Min, Lang: ?Sized> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<DelimitedBy<P, Condition, Open, Close, Delim, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>where
Open: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>,
Close: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>,
Delim: Clone,
L: Lexer<'inp>,
P: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Ctx::Emitter: DelimiterEmitter<'inp, Delim, L, Lang> + RepeatedEmitter<'inp, O, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
<Ctx::Emitter as Emitter<'inp, L, Lang>>::Error: From<UnexpectedEot<L::Offset, Lang>>,
Container: Default + DelimiterContainer<Spanned<L::Token, L::Span>, Spanned<L::Token, L::Span>, O>,
Max: MaxSpec,
Min: MinSpec,
impl<'inp, L, P, Open, Close, O, Condition, Container, Ctx, Delim, W, Max, Min, Lang: ?Sized> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<DelimitedBy<P, Condition, Open, Close, Delim, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>where
Open: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>,
Close: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>,
Delim: Clone,
L: Lexer<'inp>,
P: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Ctx::Emitter: DelimiterEmitter<'inp, Delim, L, Lang> + RepeatedEmitter<'inp, O, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
<Ctx::Emitter as Emitter<'inp, L, Lang>>::Error: From<UnexpectedEot<L::Offset, Lang>>,
Container: Default + DelimiterContainer<Spanned<L::Token, L::Span>, Spanned<L::Token, L::Span>, O>,
Max: MaxSpec,
Min: MinSpec,
Source§fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Try to parse from the given input.
Source§fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
Wraps the output of this parser in a
Spanned with the span of the parsed input.Source§fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
Wraps the output of this parser in a
Sliced with the source slice of the parsed input.Source§fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
Wraps the output of this parser in a
Located with the span and source slice of the parsed input.Source§fn repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
Creates a
Repeated combinator that applies this parser repeatedly
until the condition handler Condition returns [RepeatedAction::End] or an fatal error.Source§fn separated_by<SepClassifier, Condition, W>(
self,
sep_classifier: SepClassifier,
condition: Condition,
) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
Filter the output of this parser using a validation function. Read more
Source§fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
Filter and map the output of this parser using a validation/transformation function. Read more
Source§fn validate<F>(self, validator: F) -> Validate<Self, F>
fn validate<F>(self, validator: F) -> Validate<Self, F>
Validate the output of this parser with full location context. Read more
Source§fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
Sequence this parser with another, using the first result to determine the second parser.
Source§fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
Sequence this parser with another, ignoring the output of the first.
Source§fn recover<R>(self, recovery: R) -> Recover<Self, R>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
Source§impl<'inp, L, P, SepClassifier, Condition, O, Container, Ctx, Open, Close, Delim, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<DelimitedSeparatedBy<P, SepClassifier, Condition, Open, Close, Delim, O, W, L, Ctx, SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, Container, Ctx, Lang>where
L: Lexer<'inp>,
P: ParseInput<'inp, L, O, Ctx, Lang>,
Delim: Clone,
Open: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>,
Close: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
SepClassifier: Check<L::Token>,
Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang> + DelimiterEmitter<'inp, Delim, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
<Ctx::Emitter as Emitter<'inp, L, Lang>>::Error: From<UnexpectedEot<L::Offset, Lang>>,
Container: Default + DelimiterContainer<Spanned<L::Token, L::Span>, Spanned<L::Token, L::Span>, O> + SeparatorsContainer<Spanned<L::Token, L::Span>, O>,
W: Window,
Trailing: TrailingSpec,
Leading: LeadingSpec,
Max: MaxSpec,
Min: MinSpec,
impl<'inp, L, P, SepClassifier, Condition, O, Container, Ctx, Open, Close, Delim, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<DelimitedSeparatedBy<P, SepClassifier, Condition, Open, Close, Delim, O, W, L, Ctx, SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, Container, Ctx, Lang>where
L: Lexer<'inp>,
P: ParseInput<'inp, L, O, Ctx, Lang>,
Delim: Clone,
Open: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>,
Close: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
SepClassifier: Check<L::Token>,
Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang> + DelimiterEmitter<'inp, Delim, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
<Ctx::Emitter as Emitter<'inp, L, Lang>>::Error: From<UnexpectedEot<L::Offset, Lang>>,
Container: Default + DelimiterContainer<Spanned<L::Token, L::Span>, Spanned<L::Token, L::Span>, O> + SeparatorsContainer<Spanned<L::Token, L::Span>, O>,
W: Window,
Trailing: TrailingSpec,
Leading: LeadingSpec,
Max: MaxSpec,
Min: MinSpec,
Source§fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Try to parse from the given input.
Source§fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
Wraps the output of this parser in a
Spanned with the span of the parsed input.Source§fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
Wraps the output of this parser in a
Sliced with the source slice of the parsed input.Source§fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
Wraps the output of this parser in a
Located with the span and source slice of the parsed input.Source§fn repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
Creates a
Repeated combinator that applies this parser repeatedly
until the condition handler Condition returns [RepeatedAction::End] or an fatal error.Source§fn separated_by<SepClassifier, Condition, W>(
self,
sep_classifier: SepClassifier,
condition: Condition,
) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
Filter the output of this parser using a validation function. Read more
Source§fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
Filter and map the output of this parser using a validation/transformation function. Read more
Source§fn validate<F>(self, validator: F) -> Validate<Self, F>
fn validate<F>(self, validator: F) -> Validate<Self, F>
Validate the output of this parser with full location context. Read more
Source§fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
Sequence this parser with another, using the first result to determine the second parser.
Source§fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
Sequence this parser with another, ignoring the output of the first.
Source§fn recover<R>(self, recovery: R) -> Recover<Self, R>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
Source§impl<'inp, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: Default + Container<O>,
Max: MaxSpec,
Min: MinSpec,
impl<'inp, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: Default + Container<O>,
Max: MaxSpec,
Min: MinSpec,
Source§fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Try to parse from the given input.
Source§fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
Wraps the output of this parser in a
Spanned with the span of the parsed input.Source§fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
Wraps the output of this parser in a
Sliced with the source slice of the parsed input.Source§fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
Wraps the output of this parser in a
Located with the span and source slice of the parsed input.Source§fn repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
Creates a
Repeated combinator that applies this parser repeatedly
until the condition handler Condition returns [RepeatedAction::End] or an fatal error.Source§fn separated_by<SepClassifier, Condition, W>(
self,
sep_classifier: SepClassifier,
condition: Condition,
) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
Filter the output of this parser using a validation function. Read more
Source§fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
Filter and map the output of this parser using a validation/transformation function. Read more
Source§fn validate<F>(self, validator: F) -> Validate<Self, F>
fn validate<F>(self, validator: F) -> Validate<Self, F>
Validate the output of this parser with full location context. Read more
Source§fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
Sequence this parser with another, using the first result to determine the second parser.
Source§fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
Sequence this parser with another, ignoring the output of the first.
Source§fn recover<R>(self, recovery: R) -> Recover<Self, R>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
Source§impl<'inp, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<SeparatedBy<F, SepClassifier, Condition, O, W, L, Ctx, SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
SepClassifier: Check<L::Token>,
Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: Default + SeparatorsContainer<Spanned<L::Token, L::Span>, O>,
W: Window,
Trailing: TrailingSpec,
Leading: LeadingSpec,
Max: MaxSpec,
Min: MinSpec,
impl<'inp, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<SeparatedBy<F, SepClassifier, Condition, O, W, L, Ctx, SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
SepClassifier: Check<L::Token>,
Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: Default + SeparatorsContainer<Spanned<L::Token, L::Span>, O>,
W: Window,
Trailing: TrailingSpec,
Leading: LeadingSpec,
Max: MaxSpec,
Min: MinSpec,
Source§fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
Try to parse from the given input.
Source§fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
Wraps the output of this parser in a
Spanned with the span of the parsed input.Source§fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
Wraps the output of this parser in a
Sliced with the source slice of the parsed input.Source§fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
Wraps the output of this parser in a
Located with the span and source slice of the parsed input.Source§fn repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
Creates a
Repeated combinator that applies this parser repeatedly
until the condition handler Condition returns [RepeatedAction::End] or an fatal error.Source§fn separated_by<SepClassifier, Condition, W>(
self,
sep_classifier: SepClassifier,
condition: Condition,
) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
Filter the output of this parser using a validation function. Read more
Source§fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
Filter and map the output of this parser using a validation/transformation function. Read more
Source§fn validate<F>(self, validator: F) -> Validate<Self, F>
fn validate<F>(self, validator: F) -> Validate<Self, F>
Validate the output of this parser with full location context. Read more
Source§fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
Sequence this parser with another, using the first result to determine the second parser.
Source§fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
Sequence this parser with another, ignoring the output of the first.
Source§fn recover<R>(self, recovery: R) -> Recover<Self, R>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
Source§impl<'inp, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Spanned<Container, <L as Lexer<'inp>>::Span>, Ctx, Lang> for Collect<Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: Default + Container<O>,
Max: MaxSpec,
Min: MinSpec,
impl<'inp, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Spanned<Container, <L as Lexer<'inp>>::Span>, Ctx, Lang> for Collect<Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>where
L: Lexer<'inp>,
F: ParseInput<'inp, L, O, Ctx, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>,
Ctx: ParseContext<'inp, L, Lang>,
Container: Default + Container<O>,
Max: MaxSpec,
Min: MinSpec,
Source§fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Spanned<Container, L::Span>, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
fn parse_input(
&mut self,
inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<Spanned<Container, L::Span>, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Try to parse from the given input.
Source§fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
fn spanned(self) -> With<PhantomSpan, Self>where
Self: Sized,
Wraps the output of this parser in a
Spanned with the span of the parsed input.Source§fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
fn sourced(self) -> With<PhantomSliced, Self>where
Self: Sized,
Wraps the output of this parser in a
Sliced with the source slice of the parsed input.Source§fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
fn located(self) -> With<PhantomLocated, Self>where
Self: Sized,
Wraps the output of this parser in a
Located with the span and source slice of the parsed input.Source§fn repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
Creates a
Repeated combinator that applies this parser repeatedly
until the condition handler Condition returns [RepeatedAction::End] or an fatal error.Source§fn separated_by<SepClassifier, Condition, W>(
self,
sep_classifier: SepClassifier,
condition: Condition,
) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
fn separated_by_comma<Condition, W>(
self,
condition: Condition,
) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>where
Self: Sized,
L: Lexer<'inp>,
L::Token: PunctuatorToken<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>,
W: Window,
Creates a
SeparatedBy combinator that applies this parser repeatedly,Source§fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
Filter the output of this parser using a validation function. Read more
Source§fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
Filter and map the output of this parser using a validation/transformation function. Read more
Source§fn validate<F>(self, validator: F) -> Validate<Self, F>
fn validate<F>(self, validator: F) -> Validate<Self, F>
Validate the output of this parser with full location context. Read more
Source§fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
Sequence this parser with another, using the first result to determine the second parser.
Source§fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>where
Self: Sized,
G: ParseInput<'inp, L, U, Ctx, Lang>,
Sequence this parser with another, ignoring the output of the first.
Source§fn recover<R>(self, recovery: R) -> Recover<Self, R>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
Source§impl<P: PartialEq, Container: PartialEq, Ctx: PartialEq, Lang: PartialEq + ?Sized> PartialEq for Collect<P, Container, Ctx, Lang>
impl<P: PartialEq, Container: PartialEq, Ctx: PartialEq, Lang: PartialEq + ?Sized> PartialEq for Collect<P, Container, Ctx, Lang>
impl<P: Copy, Container: Copy, Ctx: Copy, Lang: Copy + ?Sized> Copy for Collect<P, Container, Ctx, Lang>
impl<P: Eq, Container: Eq, Ctx: Eq, Lang: Eq + ?Sized> Eq for Collect<P, Container, Ctx, Lang>
impl<P, Container, Ctx, Lang: ?Sized> StructuralPartialEq for Collect<P, Container, Ctx, Lang>
Auto Trait Implementations§
impl<P, Container, Ctx, Lang> Freeze for Collect<P, Container, Ctx, Lang>
impl<P, Container, Ctx, Lang> RefUnwindSafe for Collect<P, Container, Ctx, Lang>
impl<P, Container, Ctx, Lang> Send for Collect<P, Container, Ctx, Lang>
impl<P, Container, Ctx, Lang> Sync for Collect<P, Container, Ctx, Lang>
impl<P, Container, Ctx, Lang> Unpin for Collect<P, Container, Ctx, Lang>
impl<P, Container, Ctx, Lang> UnwindSafe for Collect<P, Container, Ctx, Lang>
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