repositories
/
lambda.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d3d594
)
Support multiargument lambda's
author
Mart Lubbers
<mart@martlubbers.net>
Wed, 16 May 2018 12:00:12 +0000
(14:00 +0200)
committer
Mart Lubbers
<mart@martlubbers.net>
Wed, 16 May 2018 12:00:12 +0000
(14:00 +0200)
lambda.y
patch
|
blob
|
history
diff --git
a/lambda.y
b/lambda.y
index
e65a644
..
830fa99
100644
(file)
--- 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; }