mathialo / bython

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

by2py Bug: Removes every colon #37

Open kkevlar opened 3 years ago

kkevlar commented 3 years ago

Here's a python snippet:

print("Hello World: !")

Running py2by on this snippet results in:

print("Hello World !")

The documentation explains that py2by is experimental- but I'd like to report this bug. Maybe there's an easy fix?

I discovered this bug when py2by-ing a souce file with type annotations (they break).

spannercodes commented 3 years ago

Perhaps by only removing colons followed by a \n or \r\n? But that doesn't do anything to stop multi-line strings like

""" This is:
a multi-line string """

I imagine it would be a lot more complicated to find a fix for those cases, though they will be less frequent.

emmatebibyte commented 2 years ago

Perhaps by only removing colons followed by a \n or \r\n? But that doesn't do anything to stop multi-line strings like

""" This is:
a multi-line string """

I imagine it would be a lot more complicated to find a fix for those cases, though they will be less frequent.

Why not simply stop deleting colons when it runs into a string and restart when the string is over?

xXCrash2BomberXx commented 2 years ago

Maybe my build would work better, assuming you still want to find one that may work My Build of Bython