Recursive parser raises "RangeError: Maximum call stack size exceeded"

I’m trying to parse Lambda Calculus for an implementation I made of it:

In the definition of expression, if I remove application, parsing variables and lambdas works fine (cf. tests). But as it is, it gives me the error RangeError: Maximum call stack size exceeded. I don’t understand why my definition of application creates an endless loop.

application starts by parsing lexpression, which parses expression, which starts by parsing application and so there is a loop.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.