Optional '=', then comma-separated list in parens/brackets.
(&mut self, f: F)
| 1987 | |
| 1988 | /// Optional '=', then comma-separated list in parens/brackets. |
| 1989 | fn parse_list_value<T, F>(&mut self, f: F) -> Result<Vec<T>, ParserError> |
| 1990 | where |
| 1991 | F: FnMut(&mut Self) -> Result<T, ParserError>, |
| 1992 | { |
| 1993 | let _ = self.consume_token(&Token::Eq); |
| 1994 | let delimiter = self.expect_one_of_tokens(&[Token::LParen, Token::LBracket])?; |
| 1995 | let values = self.parse_comma_separated(f)?; |
| 1996 | self.expect_token(&match delimiter { |
| 1997 | Token::LParen => Token::RParen, |
| 1998 | Token::LBracket => Token::RBracket, |
| 1999 | _ => unreachable!(), |
| 2000 | })?; |
| 2001 | Ok(values) |
| 2002 | } |
| 2003 | |
| 2004 | /// Parse a comma-separated list of 1+ items accepted by `F` |
| 2005 | fn parse_comma_separated<T, F>(&mut self, mut f: F) -> Result<Vec<T>, ParserError> |
no test coverage detected