mathialo/bython

Bython doesn't work when curly braces are in their own line

im-ahumanbeing opened this issue · 1 comments

As the title suggests, when doing something like this:

def test()
{
     return "test"
}

It gets turned into this, which doesn't work:

def test()
:
     return "test"

I think there was an effort to make this work in line 161 of parser.py:

line = re.sub(r"\n:", ":", line)

However this is applied to lines, it should be applied to infile_str_intdented, like this:

 infile_str_indented = re.sub(r"\n:", ":", infile_str_indented)

Which will fix it

There is a pull request called "parser improvements" which I think fixes this issue and brings many improvements