diff --git a/rust/src/parser.rs b/rust/src/parser.rs index 06a48db..d5334df 100644 --- a/rust/src/parser.rs +++ b/rust/src/parser.rs @@ -47,8 +47,7 @@ peg::parser! { rule funcall() -> Expr<'input> = i:id() "(" _ e:(expr() ** ("," _)) ")" _ { Expr::Funcall(i, e) } rule funcdef() -> Expr<'input> - = i:id()? "->" _ e:expr() { Expr::Funcdef(i, Box::new(e)) } / - i:id()? "->" _ b:block() { Expr::Funcdef(i, Box::new(b)) } + = i:id()? "->" _ e:(expr() / block()) { Expr::Funcdef(i, Box::new(e)) } rule letter() = ['A'..='Z'] / ['a'..='z']