Gidsss / UwUIDE

A compiler made to be cute uwu >~<
6 stars 0 forks source link

Feat/remove breaks outside loops #239

Closed am-cid closed 6 months ago

am-cid commented 6 months ago

closes #237


continued from previous pr #235 (Feat/break statement everything)

whoops forgot to even do break statements

new

  • parsing break statements
  • member check and type check does not break when encountering bweak statement

    all breaks are transpiled to ... if not inside a loop

test log

def main():
    ...
    if True:
        ...
        while True:
            break
            while True:
                break

            break

        ...
    elif True:
        ...
        _i: int = int(float(0))
        while True:
            break
            while True:
                break

            break
            _i = True

        ...
    elif True:
        ...
        while True:
            break

        ...
    else:
        ...
        ...
        while True:
            break

        ...

    ...

if __name__ == '__main__':
    # clear screen before executing
    import platform
    import os
    os.system('cls' if platform.system() == 'Windows' else 'clear')

    # declare globals
    main()