MCPcopy Create free account
hub / github.com/agenticsorg/lean-agentic / parse_app_expr

Method parse_app_expr

leanr-syntax/src/parser.rs:498–516  ·  view source on GitHub ↗

Parse application: f x y z

(&mut self)

Source from the content-addressed store, hash-verified

496
497 /// Parse application: f x y z
498 fn parse_app_expr(&mut self) -> crate::Result<Expr> {
499 let mut func = self.parse_atomic_expr()?;
500 let mut args = Vec::new();
501
502 while !self.is_eof() && self.is_atomic_start() {
503 args.push(self.parse_atomic_expr()?);
504 }
505
506 if args.is_empty() {
507 Ok(func)
508 } else {
509 let span = func.span().to(args.last().unwrap().span());
510 Ok(Expr::App {
511 span,
512 func: Box::new(func),
513 args,
514 })
515 }
516 }
517
518 /// Parse atomic (primary) expression
519 fn parse_atomic_expr(&mut self) -> crate::Result<Expr> {

Callers 1

parse_match_exprMethod · 0.80

Calls 7

parse_atomic_exprMethod · 0.80
is_atomic_startMethod · 0.80
toMethod · 0.80
spanMethod · 0.80
is_eofMethod · 0.45
pushMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected