javascript - Lambda expressions in PEG.js -
i have peg grammar problem lambda expressions, work if use syntax:
x:{y:{x+y}}(20)(30)
which equivalent of
(function(x) { return function(y) { return x+y; }; })(20)(30);
but don't work
f:{f(10)}(x:{x*x})
which equivalent of:
(function(f) { return f(10); })(function(x) { return x*x; })
is possible make second function work peg.js?
after trial , error on online grammar parser, found works:
f:{f}(x:{x*x})(10)
Comments
Post a Comment