evhub / coconut

Simple, elegant, Pythonic functional programming.
http://coconut-lang.org
Apache License 2.0
4.04k stars 120 forks source link

Some Unicode characters are replaced with a newline #825

Closed dokutan closed 7 months ago

dokutan commented 7 months ago

When coconut encounters a string literal containing either an unescaped paragraph separator (U+2029) or a line separator (U+2028), these characters are replaced by a newline. There could be other codepoints with this problem, as i haven't tested many. I have tested this behaviour with python 3.11 and coconut 3.0.4 on python 3.11. Additionally this causes a CoconutSyntaxError: linebreak in non-multi-line string if the string is not a multi-line string.

To reproduce:

printf "print('''\u2029'''=='''\n''')" | coconut   # True
printf "print('''\u2029'''=='''\n''')" | python    # False
evhub commented 7 months ago

I think this should be fixed by the same fix as for #818. so it should working on coconut-develop right now (pip install -U coconut-develop to get the fix).