Closed fnhartmann closed 9 months ago
/cib
Possible Solution
To implement this, the following approach can be taken. If a continue-statement is found, the following update-statement is subtracted before it. If possible, this deduction should be calculated into the previous operation. Otherwise the inverted update-statement is inserted into the code node before the continue. In this way the update statement is equalized.
As discussed today, we will implement only the simple cases to perform a for-loop reconstruction if a continue-statement occurs. So the deduction will be calculated into the previous operation. If there is no operation, there will be no reconstruction.
What happened?
247 discussed the issue that a continue-statement was not handled correctly during the for-loop reconstruction. For that @ebehner mentioned two solutions:
In the previous issue the first solution was implemented to close this bug. Therefore, in this follow-up issue, we will work on the second solution to avoid skipping the reconstruction completely.
Possible Solution
To implement this, the following approach can be taken. If a continue-statement is found, the following update-statement is subtracted before it. If possible, this deduction should be calculated into the previous operation. Otherwise the inverted update-statement is inserted into the code node before the continue. In this way the update statement is equalized.