Function take_till
fn take_till<Set, Input, Error, impl Into<Range>: Into<crate::stream::Range>>(occurrences: impl Into<Range>, set: Set) -> impl Parser<Input, <Input as Stream>::Slice, Error>
where
Input: StreamIsPartial + Stream,
Set: ContainsToken<<Input as Stream>::Token>,
Error: ParserError<Input>
Recognize the longest input slice (if any) till a member of a [set of tokens][ContainsToken] is found.
It doesn't consume the terminating token from the set.
[Partial version][crate::_topic::partial] will return a ErrMode::Incomplete(Needed::new(1)) if the match reaches the
end of input or if there was not match.
See also
take_untilfor recognizing up-to aliteral(w/ optional simd optimizations)- [
repeat_till][crate::combinator::repeat_till] withParser::takefor taking tokens up to aParser
Effective Signature
Assuming you are parsing a &str [Stream] with 0.. or 1.. [ranges][Range]:
# use RangeFrom;
# use *;
# use ContainsToken;
# use ContextError;
#
Example
# use ;
# use *;
use take_till;
assert_eq!;
assert_eq!; //allowed
assert_eq!;
assert_eq!;
# use ;
# use *;
# use Partial;
use take_till;
assert_eq!;
assert_eq!; //allowed
assert_eq!;
assert_eq!;