JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
85 stars 3 forks source link

Indentation within try block incorrect #322

Closed JSAbrahams closed 2 years ago

JSAbrahams commented 2 years ago

How to Reproduce

mamba source

def a := self.error_function() handle
            err1: Err1 =>
                print(err1)
                -1
            err2: Err2 =>
                print(err2)
                -2

is transpiled to:

a = None
        try:
                a: int = self.error_function()
        except Err1 as err1:
            print(err1)
            a = -1
        except Err2 as err2:
            print(err2)
            a = -2
        print(a)

Expected behavior

The indentation within the try block should only be one greater than the try.