pub(crate) fn take_up_to<Input, Output, Error:ParseError<Input>, P>(mut parser: P)
    -> impl FnMut(Input) -> IResult<Input, (Input, Output), Error>
    where P: FnMut(Input) -> IResult<Input, Output, Error>,
    Input: InputLength + InputIter + InputTake
{
    move |i: Input| {
        let input = i;
        for (index, _) in input.iter_indices() {
            let (rest, front) = input.take_split(index);
            match parser(rest) {
                    Ok((remainder, output)) =>
                        return Ok((remainder, (front, output))),
                    Err(_) => continue,
            }
        }
        Err(nom::Err::Error(Error::from_error_kind(input, ErrorKind::ManyTill)))
    }
}
/// Return the input slice up to the first occurrence of the parser,
/// and the result of the parser on match.
/// If the parser never matches, returns an error with code `ManyTill`
Return the input slice up to the first occurrence of the parser,
and the result of the parser on match.
If the parser never matches, returns an error with code `ManyTill`
Return the input slice up to the first occurrence of the parser and the result of the parser on match . If the parser never matches returns an error with code ` ManyTill `
pub(crate) fn take_up_to<Input, Output, Error:ParseError<Input>, P>(mut parser: P)
    -> impl FnMut(Input) -> IResult<Input, (Input, Output), Error>
    where P: FnMut(Input) -> IResult<Input, Output, Error>,
    Input: InputLength + InputIter + InputTake
{
    move |i: Input| {
        let input = i;
        for (index, _) in input.iter_indices() {
            let (rest, front) = input.take_split(index);
            match parser(rest) {
                    Ok((remainder, output)) =>
                        return Ok((remainder, (front, output))),
                    Err(_) => continue,
            }
        }
        Err(nom::Err::Error(Error::from_error_kind(input, ErrorKind::ManyTill)))
    }
}
pub ( crate ) fn take_up_to < Input , Output , Error : ParseError < Input > , P > ( mut parser : P ) -> impl FnMut ( Input ) -> IResult < Input , ( Input , Output ) , Error > where P : FnMut ( Input ) -> IResult < Input , Output , Error > , Input : InputLength + InputIter + InputTake { move | i : Input | { let input = i ; for ( index , _ ) in input . iter_indices ( ) { let ( rest , front ) = input . take_split ( index ) ; match parser ( rest ) { Ok ( ( remainder , output ) ) => return Ok ( ( remainder , ( front , output ) ) ) , Err ( _ ) => continue , } } Err ( nom :: Err :: Error ( Error :: from_error_kind ( input , ErrorKind :: ManyTill ) ) ) } }
Return the input slice up to the first occurrence of the parser,
and the result of the parser on match.
Return the input slice up to the first occurrence of the parser and the result of the parser on match .
parser
P