MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_label_list

Method parse_label_list

nodedb/src/control/promql/parser.rs:320–336  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

318 }
319
320 fn parse_label_list(&mut self) -> Result<Vec<String>, PromqlError> {
321 self.expect(&Token::LParen)?;
322 let mut labels = Vec::new();
323 if !matches!(self.peek(), Token::RParen) {
324 if let Token::Ident(name) = self.advance().clone() {
325 labels.push(name);
326 }
327 while matches!(self.peek(), Token::Comma) {
328 self.advance();
329 if let Token::Ident(name) = self.advance().clone() {
330 labels.push(name);
331 }
332 }
333 }
334 self.expect(&Token::RParen)?;
335 Ok(labels)
336 }
337
338 fn try_keyword(&mut self, kw: &str) -> bool {
339 if let Token::Ident(name) = self.peek()

Callers 3

try_parse_groupingMethod · 0.80

Calls 4

expectMethod · 0.45
cloneMethod · 0.45
advanceMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected