RustPython
RustPython copied to clipboard
Syntax error messages are different from CPython's
See e.g. #2570. Some of the unit tests there with "wrong error message" should be somewhat easy to fix - just correct the error message we have to match CPython's. Others might be trickier, since you'll need to add diagnostics to recognize bad syntax and give a more detailed error than "unexpected token". Also, I think around half of them could be fixed just by adding "invalid syntax" in the message for an unexpected token, since they're just checking for "invalid syntax" anywhere in the message (it's just what CPython uses to mean an unexpected token, I think).
This will also change when we decide to start emulating CPython 3.10, as that version will feature more helpful error messages.
Hi, is someone picking up this issue? I can pick it up in such a case. Is there a list of what messages are different?
Yes, a list of what's left to be changed would be priceless.
@hk1997 @mardab it's in Lib/test/test_named_expressions.py
PR #3206 fixed the "invalid syntax" ones. I tried working on the others, but don't know rust so these might be beyond my abilities.