I’m writing a lua backend for PureScript and I’ve hit a problem with luajit’s parser which is that it doesn’t support unlimited syntax levels in it’s parser (I think it’s the parser, anyway). Basically large do
blocks with lots of binds will generate a huge amount of syntax levels in the generated code.
My question is, what should I do to reduce the amount of nested blocks in the generated code? I could write some optimization pass for Effect
, which I tried but that’s a bit trickier than I initially thought. It also won’t work for other types than Effect
. I could split the nested expressions into top-level sub-expressions. That seems a bit rough and destroys readability. Do you know of any solutions to this problem?