kiriri / gd2cs.py

Regex based Python script that converts arbitrary gdscript code to C#
GNU General Public License v3.0
87 stars 12 forks source link

Add support for a `while` loop #3

Closed cgbeutler closed 3 years ago

cgbeutler commented 3 years ago

It appears the while loops are not converted by the tool.

Example input:

    #remove invalid values from arr
    var i = 0
    while i < len(arr):
        if not arr[i].is_valid():
            arr.remove( i )
        else:
            i += 1

The tool leaves the while loop alone. Everything else seems to work fine around/in it.

kiriri commented 3 years ago

Thank you for submitting these issues. I'm sure they affected a lot of people. I never used static functions, so I would have never noticed that myself. The while loop on the other hand I just presumed I had implemented alongside the other loops, and never tested :sweat_smile:

cgbeutler commented 3 years ago

Yeah, I tend to use/abuse a lot of fringe stuff. Not sure what's best to focus on. The tool does save a good amount of time as-is, though.

kiriri commented 3 years ago

The tool does save a good amount of time as-is, though.

That is very uplifting to hear!