Parse a comma-separated list of 1+ items accepted by `F`
(&mut self, mut f: F)
| 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> |
| 2006 | where |
| 2007 | F: FnMut(&mut Self) -> Result<T, ParserError>, |
| 2008 | { |
| 2009 | let mut values = vec![]; |
| 2010 | loop { |
| 2011 | values.push(f(self)?); |
| 2012 | if !self.consume_token(&Token::Comma) { |
| 2013 | break; |
| 2014 | } |
| 2015 | } |
| 2016 | Ok(values) |
| 2017 | } |
| 2018 | |
| 2019 | #[must_use] |
| 2020 | fn maybe_parse<T, F>(&mut self, mut f: F) -> Option<T> |
no test coverage detected