Module chomp::combinators::bounded
[−]
[src]
Bounded versions of combinators.
This module provides bounded versions of many
, many_till
and skip_many
.
The core range types are used to describe a half-open range of successive applications of a
parser. usize
is used to specify an exact number of iterations:
use chomp::combinators::bounded::many; use chomp::parse_only; use chomp::parsers::any; // Read any character 2 or 3 times let r: Result<Vec<_>, _> = parse_only(|i| many(i, 2..4, any), b"abcd"); assert_eq!(r, Ok(vec![b'a', b'b', b'c']));
Traits
BoundedRange |
Trait for applying a parser multiple times based on a range. |
Functions
many |
Applies the parser |
many_till |
Applies the parser |
sep_by |
Applies the parser |
skip_many |
Applies the parser |