mathialo / bython

Python with braces. Because python is awesome, but whitespace is awful.
MIT License
2.13k stars 54 forks source link

comments inlined with functions cause a syntax error #14

Closed RaniSargees closed 6 years ago

RaniSargees commented 6 years ago
def test(x): #prints x
     print(x)

is converted to

def test(x) #prints x
{
    print(x);
}

which when run is converted to

def text(x) #prints x:
    print(x)

which causes a syntax error because the : is commented out.

mathialo commented 6 years ago

This is an interesting bug, thanks for noticing and reporting!

b1f6c1c4 commented 6 years ago

@mathialo Could you please include testcase/* in the git repo? It's considered a good software engineering practice and would be VERY beneficial for debugging.

mathialo commented 6 years ago

@b1f6c1c4 I have now cleaned up and included the testcases directory, thanks for the tip!

The issue is now solved (somewhat ugly, I admit) by commit d1637ab107b1f72b8ec7b19c1799892a208f4d67