pub fn parse_vec_of_literals(token: &TokenTree) -> Result<Vec<String>, String> {
    match token {
        TokenTree::Group(group) => {
            let mut inner_iter = group.stream().into_iter();
            let mut result = Vec::new();
            while let Some(symbol) = inner_iter.next() {
                match extract_literal_string(&symbol, &mut inner_iter)? {
                    Some(dat) => result.push(dat),
                    None => {
                        return Err(format!("{:?} cannot be interpreted as a literal.", symbol));
                    }
                }
            }
            Ok(result)
        }
        invalid => Err(format!(
            "{:?} cannot be parsed as a vec of literals",
            invalid
        )),
    }
}
/// Parse a token as a vec of strings that can be parsed as datums in a row.
///
/// The token is assumed to be of the form `[datum1 datum2 .. datumn]`.
Parse a token as a vec of strings that can be parsed as datums in a row.
The token is assumed to be of the form `[datum1 datum2 .. datumn]`.
Parse a token as a vec of strings that can be parsed as datums in a row . The token is assumed to be of the form ` [ datum1 datum2 .. datumn ] ` .
pub fn parse_vec_of_literals(token: &TokenTree) -> Result<Vec<String>, String> {
    match token {
        TokenTree::Group(group) => {
            let mut inner_iter = group.stream().into_iter();
            let mut result = Vec::new();
            while let Some(symbol) = inner_iter.next() {
                match extract_literal_string(&symbol, &mut inner_iter)? {
                    Some(dat) => result.push(dat),
                    None => {
                        return Err(format!("{:?} cannot be interpreted as a literal.", symbol));
                    }
                }
            }
            Ok(result)
        }
        invalid => Err(format!(
            "{:?} cannot be parsed as a vec of literals",
            invalid
        )),
    }
}
pub fn parse_vec_of_literals ( token : & TokenTree ) -> Result < Vec < String > , String > { match token { TokenTree :: Group ( group ) => { let mut inner_iter = group . stream ( ) . into_iter ( ) ; let mut result = Vec :: new ( ) ; while let Some ( symbol ) = inner_iter . next ( ) { match extract_literal_string ( & symbol , & mut inner_iter ) ? { Some ( dat ) => result . push ( dat ) , None => { return Err ( format ! ( " " symbol ) ) ; } } } Ok ( result ) } invalid => Err ( format ! ( " " invalid ) ) , } }
Parse a token as a vec of strings that can be parsed as datums in a row.
Parse a token as a vec of strings that can be parsed as datums in a row .
token
&TokenTree
token
&TokenTree