Closed mxlgv closed 3 years ago
I'd prefer to run the script via dos2unix rather than add the logic to the compiler to parse both styles of line-ends.
That being said it appears that we already have a transform stage in tokenize.py::clean where we replace \r\n
to \n
.
It's a bug in tpy_str_replace.
@tubocat2001: Could you confirm if PR #37 fixes this?
@rainwoodman, You really fixed that! I am glad!
TinyPy crashes with error if the file was created in notepad.exe or some other test editors. Most likely related to '\ n' and '\ r'.
test.txt
File "tinypy/compiler/py2bc.py", line 7, in compile tokens = tokenize.tokenize(s) File "tinypy/compiler/tokenize.py", line 56, in tokenize u_error('tokenize',s,T.f) File "tinypy/compiler/tokenize.py", line 25, in u_error raise Exception('error: '+ctx+'\n'+r)