pub fn parse(mut i: &str) -> Result<Vec<RouteParserToken>, (&str, ParserError)> {
    let mut tokens: Vec<RouteParserToken> = vec![];
    let mut state = ParserState::None;

    loop {
        let (ii, token) = parse_impl(i, &state).map_err(|e| match e {
            nom::Err::Error(e) | nom::Err::Failure(e) => (i, e),
            _ => panic!("parser should not be incomplete"),
        })?;
        i = ii;
        state = state.transition(token.clone()).map_err(|e| (i, e))?;
        tokens.push(token);

        // If there is no more input, break out of the loop
        if i.is_empty() {
            break;
        }
    }
    Ok(tokens)
}
/// Parse a matching string into a vector of RouteParserTokens.
Parse a matching string into a vector of RouteParserTokens.
Parse a matching string into a vector of RouteParserTokens .
pub fn parse(mut i: &str) -> Result<Vec<RouteParserToken>, (&str, ParserError)> {
    let mut tokens: Vec<RouteParserToken> = vec![];
    let mut state = ParserState::None;
    loop {
        let (ii, token) = parse_impl(i, &state).map_err(|e| match e {
            nom::Err::Error(e) | nom::Err::Failure(e) => (i, e),
            _ => panic!("parser should not be incomplete"),
        })?;
        i = ii;
        state = state.transition(token.clone()).map_err(|e| (i, e))?;
        tokens.push(token);
        // If there is no more input, break out of the loop
        if i.is_empty() {
            break;
        }
    }
    Ok(tokens)
}
pub fn parse ( mut i : & str ) -> Result < Vec < RouteParserToken > , ( & str , ParserError ) > { let mut tokens : Vec < RouteParserToken > = vec ! [ ] ; let mut state = ParserState :: None ; loop { let ( ii , token ) = parse_impl ( i , & state ) . map_err ( | e | match e { nom :: Err :: Error ( e ) | nom :: Err :: Failure ( e ) => ( i , e ) , _ => panic ! ( " " ) , } ) ? ; i = ii ; state = state . transition ( token . clone ( ) ) . map_err ( | e | ( i , e ) ) ? ; tokens . push ( token ) ; // If there is no more input, break out of the loop if i . is_empty ( ) { break ; } } Ok ( tokens ) }
Parse a matching string into a vector of RouteParserTokens.
Parse a matching string into a vector of RouteParserTokens .
i
&str
i
&str