This extends the Nit syntax with lambdas expressions.
Lambdas are basically anonymous functions, so just accept functions without a name as expressions.
~~~nit
var x = fun(i: Int): Int do
return i + 1
end
# or on a single line
var x = fun(i: Int): Int do return i + 1 end
~~~
`fun`, `do` and `end` are mandatory, the rest is optional
~~~nit
var x = fun do end
~~~
The main weirdness is the mandatory `end` that makes the following invalid
~~~nit
# invalid:
var x = (fun(i: Int): Int do return i + 1) # missing `end`, unexpected `)`
~~~
There is no semantic yet, nor implementation, this might come in some future PR
Pull-Request: #2758
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>