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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -