From: Mart Lubbers Date: Wed, 16 May 2018 12:00:12 +0000 (+0200) Subject: Support multiargument lambda's X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=a010bac56a8ba4e171aa6c3d2fd35317e14e566d;p=lambda.git Support multiargument lambda's --- diff --git a/lambda.y b/lambda.y index e65a644..830fa99 100644 --- a/lambda.y +++ b/lambda.y @@ -101,10 +101,15 @@ appterm $$ = make_ident($1->data.identifier); lambda_free($1); } - | LAMBDA IDENT DOT term + | LAMBDA abstraction + { $$ = $2; } + | OBRACE term CBRACE + { $$ = $2; } +abstraction + : IDENT abstraction { - $$ = make_abstraction($2->data.identifier, $4); - lambda_free($2); + $$ = make_abstraction($1->data.identifier, $2); + lambda_free($1); } - | OBRACE term CBRACE + | DOT term { $$ = $2; }