Lysandros Nikolaou <[email protected]> added the comment:
> Hm, but there the old parser seems at fault: it points to the last space
> rather than beyond it?
Both parsers seem to have the same behaviour, when parsing files. I just found
out that even the new parser points to the `|` if there is not trailing
whitespace:
╰─ cat -e t.py
x = 1 | 2 |$
╰─ ./python.exe t.py
File "/Users/lysnikolaou/Repositories/cpython/t.py", line 1
x = 1 | 2 |
^
SyntaxError: invalid syntax
╰─ ./python.exe -X oldparser t.py
File "/Users/lysnikolaou/Repositories/cpython/t.py", line 1
x = 1 | 2 |
^
SyntaxError: invalid syntax
I'll investigate more tomorrow.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40546>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com