From acb27abb34e5a36b6e72a936f5d5001fa0102e03 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Tue, 1 Feb 2022 10:57:50 -0600 Subject: [PATCH] Simplify simplify --- rust/src/parser.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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']