Open hexaredecimal opened 2 months ago
A solution that I have in mind is to keep track of how deep are we with if statements because it ALWAYS has else. if the count > root then generate expressions and store the results in local variables. Unwind the recursion and emit a unary checking and returning different expressions and the locals created. This is one solution that I'm going to implement right now.
Currently the compiler emits invalid Java code when another if expression is used in the body of the if expression. So the following code passes on the compiler but generates the wrong code.