Allow binary operators to be used as lambdas #876

Merged
ghallak merged 7 commits from ghallak/228 into master 2022-06-03 18:12:24 +09:00
Showing only changes of commit 7f19cf1700 - Show all commits

View File

@ -200,6 +200,7 @@ switch(f(x))
```c
Expr ::= '(' LamArgs ')' '=>' Block(Stmt) // Anonymous function (x) => x + 1
| '(' BinOp ')' // Operator lambda (+)
| 'if' '(' Expr ')' Expr 'else' Expr // If expression if(x < y) y else x
| Expr ':' Type // Type annotation 5 : int
| Expr BinOp Expr // Binary operator x + y