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:
f:{f}(x:{x*x})(10)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With