I have PEG grammar problem with lambda expressions, they work if I use syntax:
x:{y:{x+y}}(20)(30)
which is equivalent of
(function(x) { return function(y) { return x+y; }; })(20)(30);
but this don't work
f:{f(10)}(x:{x*x})
which is equivalent of:
(function(f) { return f(10); })(function(x) { return x*x; })
Is it possible to make that second function work with PEG.js?
After some trial and error on the online grammar parser, I found that this works: