MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_comma_separated

Method parse_comma_separated

src/sql-parser/src/parser.rs:2005–2017  ·  view source on GitHub ↗

Parse a comma-separated list of 1+ items accepted by `F`

(&mut self, mut f: F)

Source from the content-addressed store, hash-verified

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>

Callers 15

split_identifier_stringFunction · 0.80
parse_functionMethod · 0.80
parse_row_exprMethod · 0.80
parse_substring_exprMethod · 0.80
parse_list_valueMethod · 0.80
parse_avro_schemaMethod · 0.80
parse_source_envelopeMethod · 0.80

Calls 2

consume_tokenMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected