MCPcopy Create free account
hub / github.com/AlenVelocity/MeowScript / parse_prefix_expr

Method parse_prefix_expr

src/parser.rs:369–381  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

367 }
368
369 fn parse_prefix_expr(&mut self) -> Option<Expr> {
370 let prefix = match self.current_token {
371 Token::Bang => Prefix::Exclamation,
372 Token::Minus => Prefix::Minus,
373 Token::Plus => Prefix::Plus,
374 _ => return None,
375 };
376
377 self.next_token();
378
379 self.parse_expr(Precedence::Prefix)
380 .map(|expr| Expr::Prefix(prefix, Box::new(expr)))
381 }
382
383 fn parse_infix_expr(&mut self, left: Expr) -> Option<Expr> {
384 let infix = match self.current_token {

Callers 1

parse_exprMethod · 0.80

Calls 3

PrefixEnum · 0.85
parse_exprMethod · 0.80
next_tokenMethod · 0.45

Tested by

no test coverage detected