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

Method parse_function_call

nodedb/src/control/promql/parser.rs:208–220  ·  view source on GitHub ↗
(&mut self, name: String)

Source from the content-addressed store, hash-verified

206 }
207
208 fn parse_function_call(&mut self, name: String) -> Result<Expr, PromqlError> {
209 self.expect(&Token::LParen)?;
210 let mut args = Vec::new();
211 if !matches!(self.peek(), Token::RParen) {
212 args.push(self.parse_expr(0)?);
213 while matches!(self.peek(), Token::Comma) {
214 self.advance();
215 args.push(self.parse_expr(0)?);
216 }
217 }
218 self.expect(&Token::RParen)?;
219 Ok(Expr::Call { func: name, args })
220 }
221
222 fn parse_aggregation(&mut self, op: AggOp) -> Result<Expr, PromqlError> {
223 self.advance();

Callers 1

Calls 4

parse_exprMethod · 0.80
expectMethod · 0.45
pushMethod · 0.45
advanceMethod · 0.45

Tested by

no test coverage detected