mlhoutel / compy

transformations on python programs
https://mlhoutel.github.io/compy/
Mozilla Public License 2.0
2 stars 0 forks source link

Broken state for while recursive lambda #7

Closed mlhoutel closed 9 months ago

mlhoutel commented 1 year ago

As noticed in #6, the current state of the while statement for oneliner code is borken.

As for the precedent update to fix the flow statements in the while, for it to be correctly implemented, we must add an explicit declaration of the scoped state for the while.

For instance:

 ..., [__INL__STATE := (None, 2), __INL__TEMP := (...)], ...
mlhoutel commented 10 months ago

Correct implementation of the state handling

The target variable need to be reworked as such (starting from base target value):

The for and while statements now need to increase the count by 2, we need to reset this value at each new loop (base + 2).

We must add a check at the end of those:

The flow statements now should have these values: