Module nom::multi

source · []
Expand description

Combinators applying their child parser multiple times

Functions

countalloc

Runs the embedded parser a specified number of times. Returns the results in a Vec.

Runs the embedded parser repeatedly, filling the given slice with results. This parser fails if the input runs out before the given slice is full.

Applies a parser until it fails and accumulates the results using a given function and initial value.

Applies a parser until it fails and accumulates the results using a given function and initial value. Fails if the embedded parser does not succeed at least once.

Applies a parser n times or until it fails and accumulates the results using a given function and initial value. Fails if the embedded parser does not succeed at least m times.

Gets a number from the first parser, then applies the second parser that many times.

Gets a number from the parser and returns a subslice of the input of that size. If the parser returns Incomplete, length_data will return an error.

Gets a number from the first parser, takes a subslice of the input of that size, then applies the second parser on that subslice. If the second parser returns Incomplete, length_value will return an error.

many0alloc

Repeats the embedded parser until it fails and returns the results in a Vec.

Repeats the embedded parser until it fails and returns the number of successful iterations.

many1alloc

Runs the embedded parser until it fails and returns the results in a Vec. Fails if the embedded parser does not produce at least one result.

Repeats the embedded parser until it fails and returns the number of successful iterations. Fails if the embedded parser does not succeed at least once.

Repeats the embedded parser n times or until it fails and returns the results in a Vec. Fails if the embedded parser does not succeed at least m times.

Applies the parser f until the parser g produces a result. Returns a pair consisting of the results of f in a Vec and the result of g.

Alternates between two parsers to produce a list of elements.

Alternates between two parsers to produce a list of elements. Fails if the element parser does not produce at least one element.